BulgeEffect
A pixel shader effect that pushes its input outwards inside a circular lens, or pulls it inwards when Amount is negative - a magnifying glass one way, a pinch the other.
public class BulgeEffect : ShaderEffect
Inherits from / implements: ShaderEffect
Remarks
Only what falls inside Radius moves, and the displacement eases to nothing at the rim, so the lens blends into the untouched picture instead of showing as a hard circle. Animate Amount across zero to go from pinch to bulge in one pass.
Members at a glance
BulgeEffect | Initializes a new instance of the BulgeEffect class. |
Amount | How strongly the lens distorts. Positive values bulge outwards, negative values pinch inwards, and zero leaves the input untouched. |
CenterXY | The centre of the lens, in texture coordinates, where (0,0) is the top left of the element and (1,1) the bottom right. |
Input | The image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush. |
Radius | How far the lens reaches, in texture coordinates, measured from CenterXY. |
AmountProperty | Identifies the Amount dependency property. |
CenterXYProperty | Identifies the CenterXY dependency property. |
InputProperty | Identifies the Input dependency property. |
RadiusProperty | Identifies the Radius dependency property. |
Constructors
BulgeEffect
Initializes a new instance of the BulgeEffect class.
Properties
Amount
How strongly the lens distorts. Positive values bulge outwards, negative values pinch inwards, and zero leaves the input untouched.
CenterXY
The centre of the lens, in texture coordinates, where (0,0) is the top left of the element and (1,1) the bottom right.
Input
The image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush.
Radius
How far the lens reaches, in texture coordinates, measured from CenterXY.
Fields
AmountProperty
Identifies the Amount dependency property.
CenterXYProperty
Identifies the CenterXY dependency property.
InputProperty
Identifies the Input dependency property.
RadiusProperty
Identifies the Radius dependency property.