RadMatrix
Represents a light-weight 3*3 Matrix to be used for GDI+ transformations.
Definition
Namespace:Telerik.WinControls.Layouts
Assembly:Telerik.WinControls.dll
Syntax:
public struct RadMatrix
Constructors
Initializes a new RadMatrix, using the specified parameters.
public RadMatrix(float m11, float m12, float m21, float m22, float dx, float dy)
The matrix element at row 1, column 1.
m12floatThe matrix element at row 1, column 2.
m21floatThe matrix element at row 2, column 1.
m22floatThe matrix element at row 2, column 2.
dxfloatThe X-axis translation component.
dyfloatThe Y-axis translation component.
Initializes a new RadMatrix, rotated by the specified angle (in degrees) at origin (0, 0).
Initializes a new RadMatrix, using the elements of the specified GDI+ Matrix instance.
public RadMatrix(Matrix gdiMatrix)
The GDI+ Matrix to copy elements from.
Initializes a new RadMatrix, applying the specified X and Y values as DX and DY members of the matrix.
public RadMatrix(PointF offset)
The point containing the X and Y offset values.
Copy constructor.
Fields
The factor for converting degrees to radians.
public const float DegreeToRadian = 0.017453294
The zero matrix, which maps every point to the origin.
public static readonly RadMatrix Empty
The matrix that leaves transformed points unchanged.
public static readonly RadMatrix Identity
The coefficient multiplying the input X coordinate in the output X coordinate.
public float M11
The coefficient multiplying the input X coordinate in the output Y coordinate.
public float M12
The coefficient multiplying the input Y coordinate in the output X coordinate.
public float M21
The coefficient multiplying the input Y coordinate in the output Y coordinate.
public float M22
The single-precision approximation of pi used by the angle conversion constants.
public const float PI = 3.141593
The factor for converting radians to degrees.
public const float RadianToDegree = 57.295773
Properties
Gets the determinant - [(M11 * M22) - (M12 * M21)] - of this Matrix.
public float Determinant { get; }
Gets all the six fields of the matrix as an array.
public float[] Elements { get; }
Determines whether this matrix equals to the Identity one.
public bool IsIdentity { get; }
Determines whether this matrix may be inverted. That is to have non-zero determinant.
public bool IsInvertible { get; }
Gets the rotation (in degrees) applied to this matrix.
public float Rotation { get; }
Methods
Determines whether this matrix's components equal the six values in an array.
public bool Equals(float[] elements)
The matrix components in GDI+ element order.
Returns:true when all six components are exactly equal.
Exceptions: ArgumentExceptionelements does not contain exactly six values.
Combines the hash codes of all six matrix components.
Replaces this matrix with its inverse, or with Empty when its determinant is zero.
public void Invert()
Multiplies this matrix by another using the requested composition order.
public void Multiply(RadMatrix m, MatrixOrder order)
The matrix to multiply by.
orderMatrixOrderPrepends another matrix to this matrix.
Applies a rotation about the origin using the specified matrix composition order.
public void Rotate(float angle, MatrixOrder order)
The rotation angle in degrees.
orderMatrixOrderWhether the rotation is prepended or appended to this matrix.
Prepends a rotation about the origin.
Applies a rotation around the specified point using the requested matrix composition order.
public void RotateAt(float angle, PointF origin, MatrixOrder order)
The rotation angle in degrees.
originPointFThe point that remains fixed by the rotation.
orderMatrixOrderWhether the rotation is prepended or appended to this matrix.
Applies a scale transformation using the specified matrix composition order.
public void Scale(float scaleX, float scaleY, MatrixOrder order)
The scale factor along the X axis.
scaleYfloatThe scale factor along the Y axis.
orderMatrixOrderWhether the scale is prepended or appended to this matrix.
Transforms each point in the supplied array in place.
Transforms the top-left and bottom-right corners of a rectangle.
public RectangleF TransformRectangle(RectangleF bounds)
The rectangle to transform.
Returns:A rectangle formed from the transformed diagonal corners; this is not an axis-aligned bounding box for rotations or shears.
Applies a translation using the specified matrix composition order.
public void Translate(float dx, float dy, MatrixOrder order)
The horizontal offset.
dyfloatThe vertical offset.
orderMatrixOrderWhether the translation is prepended or appended to this matrix.