Class RenderEffect
Definition
- Assembly:
- Tizen.NUI.dll
View's optional render effect. Applications can apply RenderEffect as the example below :
BackgroundBlurEffect effect = RenderEffect.CreateBackgroundBlurEffect(20);
view.SetRenderEffect(effect); // activates effect
effect.Deactivate();
effect.Activate();
view.ClearRenderEffect(); // deactivates effect
Note that a view owns at most one render effect.
public class RenderEffect : BaseHandle, IDynamicResourceHandler, INameScope, System.IDisposable
- Inheritance
- Derived
- Implements
-
System.IDisposable
Properties
View SourceAliveCount
Gets the number of currently alived RenderEffect object.
Declaration
public static int AliveCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceActivate()
Activates render effect
Declaration
public void Activate()
CreateBackgroundBlurEffect(float)
Create a background blur effect
Declaration
public static BackgroundBlurEffect CreateBackgroundBlurEffect(float blurRadius)
Parameters
| Type | Name | Description |
|---|---|---|
| float | blurRadius | The blur radius value. The unit is pixel for standard cases. |
Returns
| Type | Description |
|---|---|
| BackgroundBlurEffect | Background blur effect with given blur radius. |
Remarks
The blurRadius parameter is adjusted due to downscaling and kernel compression, resulting in a smaller effective value. This means the blur intensity changes in discrete steps rather than continuously, with the step size determined by (2 / downscale factor). For example, with a default BlurDownscaleFactor of 0.25, the step size is 8. To ensure proper functionality, a minimum blurRadius value of 2 steps is required, with intensity updates occurring at every step size increment.
CreateGaussianBlurEffect(float)
Create a blur effect
Declaration
public static GaussianBlurEffect CreateGaussianBlurEffect(float blurRadius)
Parameters
| Type | Name | Description |
|---|---|---|
| float | blurRadius | The blur radius value. The unit is pixel for standard cases. |
Returns
| Type | Description |
|---|---|
| GaussianBlurEffect | Blur effect with given blur radius. |
Remarks
The blurRadius parameter is adjusted due to downscaling and kernel compression, resulting in a smaller effective value. This means the blur intensity changes in discrete steps rather than continuously, with the step size determined by (2 / downscale factor). For example, with a default BlurDownscaleFactor of 0.25, the step size is 8. To ensure proper functionality, a minimum blurRadius value of 2 steps is required, with intensity updates occurring at every step size increment.
CreateMaskEffect(View, MaskEffectMode, float, float, float, float)
Create a mask effect
Declaration
public static MaskEffect CreateMaskEffect(View control, MaskEffectMode maskMode, float positionX = 0, float positionY = 0, float scaleX = 1, float scaleY = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| View | control | The mask source control. |
| MaskEffectMode | maskMode | Defines pixel data type (alpha, luminance) used as the mask source. |
| float | positionX | The X Position of mask source. |
| float | positionY | The Y Position of mask source. |
| float | scaleX | The X Scale of mask source. |
| float | scaleY | The Y Scale of mask source. |
Returns
| Type | Description |
|---|---|
| MaskEffect | mask effect with given control. |
CreateMaskEffect(View)
Create a mask effect
Declaration
public static MaskEffect CreateMaskEffect(View control)
Parameters
| Type | Name | Description |
|---|---|---|
| View | control | The mask source control. |
Returns
| Type | Description |
|---|---|
| MaskEffect | mask effect with given control. |
Deactivate()
Deactivates render effect
Declaration
public void Deactivate()
Dispose(DisposeTypes)
Declaration
protected override void Dispose(DisposeTypes type)
Parameters
| Type | Name | Description |
|---|---|---|
| DisposeTypes | type |
Overrides
View SourceIsActivated()
Check whether effect is activated or not.
Declaration
public bool IsActivated()
Returns
| Type | Description |
|---|---|
| bool | True if effect is activated, False otherwise. |
Refresh()
Refreshes render effect
Declaration
public void Refresh()