Struct TransformMatrix
Encapsulates a 3-by-2 affine matrix that represents a geometric transform.
public struct TransformMatrix : IEquatable<TransformMatrix>
- Implements
Constructors
- TransformMatrix()
Initializes a new instance of the TransformMatrix class as the identity matrix.
- TransformMatrix(TransformMatrix)
Initializes a new instance of the TransformMatrix class using data from the specified matrix.
- TransformMatrix(SKMatrix)
Initializes a new instance of the TransformMatrix class using the specified SKMatrix.
- TransformMatrix(float, float, float, float, float, float)
Initializes a new instance of the TransformMatrix class with the specified elements.
Fields
- DX
Get or sets the translation in the x-direction (the dx value, or the element in the third row and first column) of the matrix. This is the same as TransX.
- DY
Get or sets the translation in the y-direction (the dy value, or the element in the third row and second column) of the matrix. This is the same as TransY.
- M11
Gets or sets the scaling in the x-direction. This is the same as ScaleX. This is the value in the first row and first column of the matrix.
- M12
Gets or sets the skew in the y-direction. This is the value in the first row and second column of the matrix. This is the same as SkewY.
- M21
Gets or sets the skew in the x-direction. This is the value in the second row and first column of the matrix. This is the same as SkewX.
- M22
Gets or sets the scaling in the y-direction. This is the value in the second row and second column of the matrix. This is the same as ScaleY.
- Matrix3x2
Represents a 3x2 matrix used for transformations in 2D space.
- Row0
Represents the first row of a 2x2 matrix, where the X component corresponds to M11 and the Y component corresponds to M12.
- ScaleX
Gets or sets the scaling in the x-direction. This is the same as M11. This is the value in the first row and first column of the matrix.
- ScaleY
Gets or sets the scaling in the y-direction. This is the same as M22. This is the value in the second row and second column in the matrix.
- SkewX
Gets or sets the skew in the x-direction. This is the same as M21. This is the value in the second row and first column in the matrix.
- SkewY
Gets or sets the skew in the y-direction. This is the value in the first row and second column in the matrix. This is the same as M12.
- TransX
Get or sets the translation in the x-direction. This is the same as DX. This is the value in the third row and first column in the matrix.
- TransY
Get or sets the translation in the y-direction. This is the same as DY. This is the value in the third row and second column in the matrix.
- Translation
Represents the translation vector with X and Y components.
Properties
- Determinant
Gets the determinant of this matrix.
- Elements
Gets an array of floating-point values that represents the elements of this TransformMatrix.
- IsIdentity
Gets a value indicating whether this TransformMatrix is the identity matrix.
- IsMirrored
Gets a value indicating whether the object is mirrored along either the X or Y axis.
- IsMirroredX
Gets a value indicating whether the object is mirrored along the X-axis.
- IsMirroredY
Gets a value indicating whether the transformation includes a vertical mirroring.
Methods
- Assign(TransformMatrix)
Assigns matrix values with data from the specified matrix;
- Clone()
Creates a copy of this matrix.
- CreateRotation(float)
Creates a TransformMatrix with clockwise rotation of the specified angle about the origin.
- CreateScale(float, float)
Creates a TransformMatrix with the specified scale vector.
- CreateTranslation(float, float)
Creates a TransformMatrix with the specified translation vector.
- Equals(TransformMatrix)
Gets whether this matrix equals another matrix.
- Equals(object?)
Indicates whether this instance and a specified object are equal.
- GetHashCode()
Returns the hash code for this instance.
- GetRotationAngleInDegrees()
Extracts the rotation angle in degrees from this matrix. Returns 0 if there's no rotational component (identity rotation).
- GetRotationAngleInRadians()
Extracts the clockwise rotation angle in radians from the transform matrix. Compatible with wxGraphicsContext::DrawText angle parameter.
- Invert()
Inverts this matrix, if it is invertible.
- IsRotationIdentity()
Determines whether the current transformation matrix represents an identity rotation.
- Multiply(TransformMatrix)
Multiplies this TransformMatrix by the specified TransformMatrix by prepending the specified TransformMatrix.
- Reset()
Resets this TransformMatrix to have the elements of the identity matrix.
- Rotate(float)
Applies a clockwise rotation of the specified angle (degrees) about the origin to this TransformMatrix.
- RotateRadians(float)
Applies a clockwise rotation of the specified angle (radians) about the origin to this TransformMatrix.
- Scale(float, float)
Applies the specified scale vector to this TransformMatrix by prepending the scale vector.
- TransformPoint(PointD)
Applies the geometric transform this TransformMatrix represents to a point.
- TransformRect(RectD)
Applies the geometric transform this TransformMatrix represents to a rectangle.
- TransformSize(SizeD)
Applies the geometric transform this TransformMatrix represents to a size.
- Translate(float, float)
Applies the specified translation vector to this TransformMatrix by prepending the translation vector.
Operators
- operator ==(TransformMatrix, TransformMatrix)
Tests whether two specified TransformMatrix structures are equivalent.
- operator !=(TransformMatrix, TransformMatrix)
Tests whether TransformMatrix and TransformMatrix structures are different.