C# Class SwfDotNet.IO.Tags.Types.Matrix

Matrix is used to specify two-dimensional coordinate transforms, allowing an object to be scaled, rotated or moved without changing the original definition of how the object is drawn.

A two-dimensional transform is defined using a 3x3 matrix and the new values for a pair of coordinates (x, y) are calculated using a matrix multiplication (see Macromedia specifications).

Different transformations such as scaling, rotation, shearing and translation can be performed using the above matrix multiplication. More complex transformations can be defined by performing successive matrix multiplications in a process known as compositing. This allows a complex transformations to performed on an object.

This tag was introduced in Flash 1.

Inheritance: SizeStruct, ISwfSerializer
显示文件 Open project: bladecoding/SwfExport

Public Methods

Method Description
GetSizeOf ( ) : int

Gets the size of.

IsUnityTransform ( ) : bool

Get if the matrix transformation will not change the physical appearance or location of a shape.

Matrix ( ) : System

Creates a new Matrix instance.

Matrix ( float matrix ) : System

Creates a new Matrix instance.

Matrix ( int x, int y ) : System

Creates a new Matrix instance.

Matrix ( int x, int y, double scaleX, double scaleY ) : System

Creates a new Matrix instance.

ReadData ( BufferedBinaryReader binaryReader ) : void

Reads the data.

Rotate ( double angle ) : void

Sets the angle which the transform will rotate an object.

Scale ( double x, double y ) : void

Sets the scaling factor for the transform.

Serialize ( XmlWriter writer ) : void

Serializes the specified writer.

Shear ( double x, double y ) : void

Sets the shearing factor for the transform.

TransformPoint ( int x, int y ) : int[]

Applies the transformation to the coordinates of a point.

Translate ( int x, int y ) : void

Sets the translation points of the transform.

WriteTo ( BufferedBinaryWriter binaryWriter ) : void

Writes to.

Private Methods

Method Description
Composite ( float m ) : void

Composites the specified m.

ConvertToRadians ( double angle ) : double

Converts to radians.

GetRotateBitsNum ( ) : uint

Gets the rotate bits num.

GetScaleBitsNum ( ) : uint

Gets the scale bits num.

GetTranslateBitsNum ( ) : uint

Gets the translate bits num.

HasRotate ( ) : bool

Determines whether this instance has rotate.

HasScale ( ) : bool

Determines whether this instance has scale.

HasTranslate ( ) : bool

Determines whether this instance has translate.

Method Details

GetSizeOf() public method

Gets the size of.
public GetSizeOf ( ) : int
return int

IsUnityTransform() public method

Get if the matrix transformation will not change the physical appearance or location of a shape.
public IsUnityTransform ( ) : bool
return bool

Matrix() public method

Creates a new Matrix instance.
public Matrix ( ) : System
return System

Matrix() public method

Creates a new Matrix instance.
public Matrix ( float matrix ) : System
matrix float Matrix.
return System

Matrix() public method

Creates a new Matrix instance.
public Matrix ( int x, int y ) : System
x int X.
y int Y.
return System

Matrix() public method

Creates a new Matrix instance.
public Matrix ( int x, int y, double scaleX, double scaleY ) : System
x int X.
y int Y.
scaleX double Scale X.
scaleY double Scale Y.
return System

ReadData() public method

Reads the data.
public ReadData ( BufferedBinaryReader binaryReader ) : void
binaryReader SwfDotNet.IO.Utils.BufferedBinaryReader Binary reader.
return void

Rotate() public method

Sets the angle which the transform will rotate an object.
public Rotate ( double angle ) : void
angle double Angle value, in degrees, to rotate the object clockwise.
return void

Scale() public method

Sets the scaling factor for the transform.
public Scale ( double x, double y ) : void
x double Value to scale the object in the x direction.
y double Value to scale the object in the y direction.
return void

Serialize() public method

Serializes the specified writer.
public Serialize ( XmlWriter writer ) : void
writer System.Xml.XmlWriter Writer.
return void

Shear() public method

Sets the shearing factor for the transform.
public Shear ( double x, double y ) : void
x double Value to shear the object in the x direction.
y double Value to shear the object in the y direction.
return void

TransformPoint() public method

Applies the transformation to the coordinates of a point.
public TransformPoint ( int x, int y ) : int[]
x int X-coordinate of a point.
y int Y-coordinate of a point.
return int[]

Translate() public method

Sets the translation points of the transform.
public Translate ( int x, int y ) : void
x int The x-coordinate where the object will be displayed.
y int The y-coordinate where the object will be displayed.
return void

WriteTo() public method

Writes to.
public WriteTo ( BufferedBinaryWriter binaryWriter ) : void
binaryWriter SwfDotNet.IO.Utils.BufferedBinaryWriter Binary writer.
return void