This method creates a motion blur effect on a raster image.

[Visual Basic] Public Function MotionBlur(mode As Integer, length As Integer, angle As Integer) As Boolean
[C#] public bool MotionBlur(int mode, int length, int angle);

Parameters

mode
   Sets the type of blur (0: Linear, 1: Radial, 2: Zoom)

length   Sets the length of the blur (from 0 to 255)

angle   Sets the angle of the blur (in degrees from 0 to 360)

Return Value

Returns True if successful. Returns False if unsuccessful.

Explanation

The MotionBlur method creates a motion blur effect on a raster image. The Mode parameter determines the type of motion blur.

Mode=0 (Linear blur)
This motion blur simulates the image shifting. The Length parameter sets the magnitude of the shift. The Angle parameter determines the direction of the shift. The major directions of the Angle parameter are as follows: Angle=0 -> a shift to the left; Angle= 90 -> a shift down; Angle= 180 -> ashift to the right; Angle= 270-> a shift up.

Mode=1 (Radial blur)
This motion blur simulates the image spinning by the number of degrees set in the Angle parameter. The Length parameter is ineffective.

Mode=2 (Zoom blur)
This motion blur simulates the image zooming in by the length set in the Length parameter. The Angle parameter is ineffective.

To execute the MotionBlur method, set the image handle of the image in the Image property or the Layer(LayerNumber).Image property. The MotionBlur method supports 8 bit grayscale, 16, 24, and 32 bit images.

Before executing the MotionBlur method, you must set the area on the image that will be affected. There are 4 ways to do this.

  1. To use a mask image, set the SelectMode property to EffectMask. Set the mask image handle in the SourceMask property
  2. To process the total image, set the SelectMode property to EffectAll
  3. To process the polygonal area on the image, set the SelectMode property to EffectPolygon. Select the polygon by setting the appropriate coordinate values for the points of the polygon in the Point property
  4. To process an elliptical area on the image, set the SelectMode property to EffectEllipse. Select the ellipse by setting the appropriate values for the bounding rectangle in the Rect property

When the SelectMode property is set to EffectPolygon or EffectEllipse, the appropriate values must be set in the Inside property.

If the MotionBlur method is successful and the DestinationAsImageKitImage property is True, the resulting image will be set in the Image property or in the Layer(LayerNumber).Image property, according to the value set in the LayerNumber property.

If the MotionBlur method is successful and the DestinationAsImageKitImage property is False, the resulting image will be set in the DestinationImage property.

See Also

ImageKit.Effect Members | Newtone.ImageKit.Wpf.ImageKit

The ImageKit WPF is created by Newtone Corporation