Packageorg.flashsandy.display
Classpublic class DistortImage

Tesselates an area into several triangles to allow free transform distortion on BitmapData objects.



Public Properties
 PropertyDefined by
  height : Number
[read-only] Height of this DistortImage instance.
DistortImage
  hPrecision : uint
[read-only] Horizontal precision of this DistortImage instance.
DistortImage
  smoothing : Boolean = true
Indicates whether or not use pixelsmoothing in the beginBitmapFill method of the Graphics class.
DistortImage
  vPrecision : uint
[read-only] Vertical precision of this DistortImage instance.
DistortImage
  width : Number
[read-only] Width of this DistortImage instance.
DistortImage
Public Methods
 MethodDefined by
  
DistortImage(w:Number, h:Number, hseg:uint = 2, vseg:uint = 2)
Constructor.
DistortImage
  
setPrecision(horizontal:Number, vertical:Number):void
Sets the precision of this DistortImage instance and re-initializes the triangular grid.
DistortImage
  
setSize(width:Number, height:Number):void
Sets the size of this DistortImage instance and re-initializes the triangular grid.
DistortImage
  
setTransform(graphics:Graphics, bmd:BitmapData, tl:Point, tr:Point, br:Point, bl:Point):void
Distorts the provided BitmapData according to the provided Point instances and draws it onto the provided Graphics.
DistortImage
Property detail
heightproperty
height:Number  [read-only]

Height of this DistortImage instance. Property can only be set through the class constructor.

Implementation
    public function get height():Number

See also

hPrecisionproperty 
hPrecision:uint  [read-only]

Horizontal precision of this DistortImage instance. Property can only be set through the class constructor.

Implementation
    public function get hPrecision():uint

See also

smoothingproperty 
public var smoothing:Boolean = true

Indicates whether or not use pixelsmoothing in the beginBitmapFill method of the Graphics class.

The default value is true.

vPrecisionproperty 
vPrecision:uint  [read-only]

Vertical precision of this DistortImage instance. Property can only be set through the class constructor.

Implementation
    public function get vPrecision():uint

See also

widthproperty 
width:Number  [read-only]

Width of this DistortImage instance. Property can only be set through the class constructor.

Implementation
    public function get width():Number

See also

Constructor detail
DistortImage()constructor
public function DistortImage(w:Number, h:Number, hseg:uint = 2, vseg:uint = 2)

Constructor.

Parameters
w:Number — Width of the image to be processed
 
h:Number — Height of image to be processed
 
hseg:uint (default = 2) — Horizontal precision
 
vseg:uint (default = 2) — Vertical precision
Method detail
setPrecision()method
public function setPrecision(horizontal:Number, vertical:Number):void

Sets the precision of this DistortImage instance and re-initializes the triangular grid.

Parameters
horizontal:Number — New horizontal precision.
 
vertical:Number — New vertical precision.

See also

setSize()method 
public function setSize(width:Number, height:Number):void

Sets the size of this DistortImage instance and re-initializes the triangular grid.

Parameters
width:Number — New width.
 
height:Number — New height.

See also

setTransform()method 
public function setTransform(graphics:Graphics, bmd:BitmapData, tl:Point, tr:Point, br:Point, bl:Point):void

Distorts the provided BitmapData according to the provided Point instances and draws it onto the provided Graphics.

Parameters
graphics:Graphics — Graphics on which to draw the distorted BitmapData
 
bmd:BitmapData — The undistorted BitmapData
 
tl:Point — Point specifying the coordinates of the top-left corner of the distortion
 
tr:Point — Point specifying the coordinates of the top-right corner of the distortion
 
br:Point — Point specifying the coordinates of the bottom-right corner of the distortion
 
bl:Point — Point specifying the coordinates of the bottom-left corner of the distortion