Matrix Class
Summary: Replaces the GDI+ Matrix.
Module: aspose.imaging
Full Name: aspose.imaging.Matrix
Constructors
Name | Description |
---|---|
Matrix() | Initializes a new instance of the Matrix class as the identity matrix. |
Matrix(m11, m12, m21, m22, m31, m32) | Initializes a new instance of the Matrix class. |
Matrix(origin) | Makes a copy of the Matrix class. |
Matrix(rect, plgpts) | Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points. |
Matrix(rect, plgpts) | Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points. |
Properties
Name | Type | Access | Description |
---|---|---|---|
TYPE_FLIP [static] | int | r | This flag bit indicates that the transform defined by this object performs a mirror image flip about some axis which changes the normally right handed coordinate system into a left handed system in addition to the conversions indicated by other flag bits. A right handed coordinate system is one where the positive X axis rotates counterclockwise to overlay the positive Y axis similar to the direction that the fingers on your right hand curl when you stare end on at your thumb. A left handed coordinate system is one where the positive X axis rotates clockwise to overlay the positive Y axis similar to the direction that the fingers on your left hand curl. There is no mathematical way to determine the angle of the original flipping or mirroring transformation since all angles of flip are identical given an appropriate adjusting rotation. NOTE: TypeFlip was added after GENERAL_TRANSFORM was in public circulation and the flag bits could no longer be conveniently renumbered without introducing binary incompatibility in outside code. |
TYPE_GENERAL_ROTATION [static] | int | r | This flag bit indicates that the transform defined by this object performs a rotation by an arbitrary angle in addition to the conversions indicated by other flag bits. A rotation changes the angles of vectors by the same amount regardless of the original direction of the vector and without changing the length of the vector. This flag bit is mutually exclusive with the |
TYPE_GENERAL_SCALE [static] | int | r | A general scale multiplies the length of vectors by different amounts in the x and y directions without changing the angle between perpendicular vectors. This flag bit is mutually exclusive with the TypeUniformScale flag. |
TYPE_GENERAL_TRANSFORM [static] | int | r | This constant indicates that the transform defined by this object performs an arbitrary conversion of the input coordinates. If this transform can be classified by any of the above constants, the type will either be the constant TypeIdentity or a combination of the appropriate flag bits for the various coordinate conversions that this transform performs. |
TYPE_IDENTITY [static] | int | r | An identity transform is one in which the output coordinates are always the same as the input coordinates. If this transform is anything other than the identity transform, the type will either be the constant GENERAL_TRANSFORM or a combination of the appropriate flag bits for the various coordinate conversions that this transform performs. |
TYPE_MASK_ROTATION [static] | int | r | This constant is a bit mask for any of the rotation flag bits. |
TYPE_MASK_SCALE [static] | int | r | This constant is a bit mask for any of the scale flag bits. |
TYPE_QUADRANT_ROTATION [static] | int | r | This flag bit indicates that the transform defined by this object performs a quadrant rotation by some multiple of 90 degrees in addition to the conversions indicated by other flag bits. A rotation changes the angles of vectors by the same amount regardless of the original direction of the vector and without changing the length of the vector. This flag bit is mutually exclusive with the TypeGeneralRotation flag. |
TYPE_TRANSLATION [static] | int | r | A translation moves the coordinates by a constant amount in x and y without changing the length or angle of vectors. |
TYPE_UNIFORM_SCALE [static] | int | r | A uniform scale multiplies the length of vectors by the same amount in both the x and y directions without changing the angle between vectors. This flag bit is mutually exclusive with the TypeGeneralScale flag. |
elements | float | r | Gets an array of floating-point values that represents the elements of this Matrix. |
m11 | float | r | Gets the matrix element at first row first column. Represents scale along X axis. |
m12 | float | r | Gets the matrix element at first row second column. Represents shear along Y axis. |
m21 | float | r | Gets the matrix element at second row first column. Represents shear along X axis. |
m22 | float | r | Gets the matrix element at second row second column. Represents scale along Y axis. |
m31 | float | r | Gets the matrix element at third row first column. Represents translation along X axis. |
m32 | float | r | Gets the matrix element at third row first column. Represents translation along Y axis. |
Methods
Name | Description |
---|---|
create_with_rect(rect, plgpts) | Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points. |
create_with_rect_f(rect, plgpts) | Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points. |
get_elements() | Gets the copy of matrix elements. |
multiply(t_tx) | Multiplies this Matrix by the matrix specified in the matrix parameter using (default) Prepend order. |
multiply(t_tx, order) | Multiplies this Matrix by the matrix specified in the matrix parameter, and in the order specified in the order parameter. |
reset() | Resets this Matrix to have the elements of the identity matrix. |
rotate(angle) | Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix in the default (Prepend) order. |
rotate(angle, order) | Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix in the specified order. |
rotate_at(angle, point) | Applies a clockwise rotation about the specified point to this Matrix in the default (Prepend) order. |
rotate_at(angle, point, order) | Applies a clockwise rotation about the specified point to this Matrix in the specified order. |
scale(scale_x, scale_y, order) | Applies the specified scale vector (scaleX and scaleY) to this Matrix using the specified order. |
scale(sx, sy) | Applies the specified scale vector (scaleX and scaleY) to this Matrix using (default) Prepend order. |
transform_points(points) | Applies the geometric transform represented by this Matrix to a specified array of points. |
translate(offset_x, offset_y, order) | Applies the specified translation vector to this Matrix in the specified order. |
translate(tx, ty) | Applies the specified translation vector to this Matrix using (default) Prepend order. |
Constructor: Matrix()
Matrix()
Initializes a new instance of the Matrix class as the identity matrix.
Constructor: Matrix(m11, m12, m21, m22, m31, m32)
Matrix(m11, m12, m21, m22, m31, m32)
Initializes a new instance of the Matrix class.
Parameters:
Parameter | Type | Description |
---|---|---|
m11 | float | m00 M11 Scale X |
m12 | float | m10 M12 Shear Y |
m21 | float | m01 M21 Shear X |
m22 | float | m11 M22 Scale Y |
m31 | float | m02 M31 Translate X |
m32 | float | m12 M32 Translate Y |
Constructor: Matrix(origin)
Matrix(origin)
Makes a copy of the Matrix class.
Parameters:
Parameter | Type | Description |
---|---|---|
origin | Matrix | A base matrix for coping |
Constructor: Matrix(rect, plgpts)
Matrix(rect, plgpts)
Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | RectangleF | A RectangleF structure that represents the rectangle to be transformed. |
plgpts | PointF[] | An array of three PointF structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners of the rectangle is to be transformed. The lower-right corner of the parallelogram is implied by the first three corners. |
Constructor: Matrix(rect, plgpts)
Matrix(rect, plgpts)
Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | Rectangle | A RectangleF structure that represents the rectangle to be transformed. |
plgpts | Point[] | An array of three PointF structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners of the rectangle is to be transformed. The lower-right corner of the parallelogram is implied by the first three corners. |
Method: create_with_rect(rect, plgpts) [static]
create_with_rect(rect, plgpts)
Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | Rectangle | A RectangleF structure that represents the rectangle to be transformed. |
plgpts | Point[] | An array of three PointF structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners of the rectangle is to be transformed. The lower-right corner of the parallelogram is implied by the first three corners. |
Returns
Type | Description |
---|---|
Matrix |
Method: create_with_rect_f(rect, plgpts) [static]
create_with_rect_f(rect, plgpts)
Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | RectangleF | A RectangleF structure that represents the rectangle to be transformed. |
plgpts | PointF[] | An array of three PointF structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners of the rectangle is to be transformed. The lower-right corner of the parallelogram is implied by the first three corners. |
Returns
Type | Description |
---|---|
Matrix |
Method: get_elements()
get_elements()
Gets the copy of matrix elements.
Returns
Type | Description |
---|---|
float | A matrix elements copy. |
Method: multiply(t_tx)
multiply(t_tx)
Multiplies this Matrix by the matrix specified in the matrix parameter using (default) Prepend order.
Parameters:
Parameter | Type | Description |
---|---|---|
t_tx | Matrix | The matrix to multiply with. |
Method: multiply(t_tx, order)
multiply(t_tx, order)
Multiplies this Matrix by the matrix specified in the matrix parameter, and in the order specified in the order parameter.
Parameters:
Parameter | Type | Description |
---|---|---|
t_tx | Matrix | The tx. The tx. The tx. |
order | MatrixOrder | The order. The order. The order. |
Method: rotate(angle)
rotate(angle)
Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix in the default (Prepend) order.
Parameters:
Parameter | Type | Description |
---|---|---|
angle | float | The rotate angle. |
Method: rotate(angle, order)
rotate(angle, order)
Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
angle | float | The rotate angle. |
order | MatrixOrder | The matrix order. |
Method: rotate_at(angle, point)
rotate_at(angle, point)
Applies a clockwise rotation about the specified point to this Matrix in the default (Prepend) order.
Parameters:
Parameter | Type | Description |
---|---|---|
angle | float | The angle. |
point | PointF | The point. |
Method: rotate_at(angle, point, order)
rotate_at(angle, point, order)
Applies a clockwise rotation about the specified point to this Matrix in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
angle | float | The angle. |
point | PointF | The point. |
order | MatrixOrder | The order. |
Method: scale(scale_x, scale_y, order)
scale(scale_x, scale_y, order)
Applies the specified scale vector (scaleX and scaleY) to this Matrix using the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
scale_x | float | The scale X. |
scale_y | float | The scale Y. |
order | MatrixOrder | The order. |
Method: scale(sx, sy)
scale(sx, sy)
Applies the specified scale vector (scaleX and scaleY) to this Matrix using (default) Prepend order.
Parameters:
Parameter | Type | Description |
---|---|---|
sx | float | The sx. The sx. The sx. |
sy | float | The sy. The sy. The sy. |
Method: transform_points(points)
transform_points(points)
Applies the geometric transform represented by this Matrix to a specified array of points.
Parameters:
Parameter | Type | Description |
---|---|---|
points | PointF[] | The points. |
Method: translate(offset_x, offset_y, order)
translate(offset_x, offset_y, order)
Applies the specified translation vector to this Matrix in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
offset_x | float | The offset X. |
offset_y | float | The offset Y. |
order | MatrixOrder | The order. |
Method: translate(tx, ty)
translate(tx, ty)
Applies the specified translation vector to this Matrix using (default) Prepend order.
Parameters:
Parameter | Type | Description |
---|---|---|
tx | float | The tx. The tx. The tx. |
ty | float | The ty. The ty. The ty. |