RadMatrix
Represents a layout transform that stores a translation offset.
Definition
Namespace:Telerik.WinForms.Documents.Layout
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public struct RadMatrix
Constructors
Initializes the matrix with the specified offsets; the coefficient parameters are not stored.
public RadMatrix(float m11, float m12, float m21, float m22, float dx, float dy)
Ignored; the matrix uses a fixed identity coefficient.
m12floatIgnored; the matrix uses a fixed identity coefficient.
m21floatIgnored; the matrix uses a fixed identity coefficient.
m22floatIgnored; the matrix uses a fixed identity coefficient.
dxfloatThe horizontal translation offset.
dyfloatThe vertical translation offset.
Computes a translation offset for the specified scale values around an origin. The scale itself is not retained, so transformed points are not scaled.
Initializes a zero-offset matrix from the specified scale values at the origin.
Computes a translation offset for rotating around an origin. The rotation itself is not retained, so transformed points are translated rather than rotated.
Initializes a zero-offset matrix for the specified angle at the origin. The rotation itself is not applied to transformed points.
Copies the translation offsets from another matrix.
public RadMatrix(RadMatrix source)
The matrix whose offsets are copied.
Fields
The factor for converting degrees to radians.
public const float DegreeToRadian = 0.017453294
Represents a zero-offset transform; it compares equal to Identity.
public static readonly RadMatrix Empty
Represents the zero-offset transform with fixed identity coefficients.
public static readonly RadMatrix Identity
The fixed first diagonal coefficient; it is 1 for every RadMatrix.
public static readonly float M11
The fixed first off-diagonal coefficient; it is 0 for every RadMatrix.
public static readonly float M12
The fixed second off-diagonal coefficient; it is 0 for every RadMatrix.
public static readonly float M21
The fixed second diagonal coefficient; it is 1 for every RadMatrix.
public static readonly float M22
The factor for converting radians to degrees.
public const float RadianToDegree = 57.295773
Properties
Gets the determinant of the fixed identity coefficients, which is always 1.
public float Determinant { get; }
Determines whether both translation offsets are zero. In this implementation, this also makes the matrix equal to Identity.
public bool IsEmpty { get; }
Determines whether both translation offsets are zero. In this implementation, this also makes the matrix equal to Empty.
public bool IsIdentity { get; }
Determines whether this matrix may be inverted; the fixed coefficients make this value always true.
public bool IsInvertible { get; }
Gets the rotation in degrees derived from the fixed coefficients; this implementation always reports 0.
public float Rotation { get; }
Gets the X-axis scale measured from transformed unit points; the fixed coefficients normally yield 1, though large offsets can affect the result through floating-point precision.
public float ScaleX { get; }
Methods
Compares the six matrix elements with the specified array using exact float equality.
public bool Equals(float[] elements)
The six-element array to compare with this matrix.
Returns: Exceptions: ArgumentExceptionelements does not contain exactly six values.
Returns a hash code based on the fixed coefficients and translation offsets.
Combines this matrix with another by adding their translation offsets; order does not affect the result.
public void Multiply(RadMatrix matrix, MatrixOrder order)
The matrix whose offsets are added.
orderMatrixOrderThe multiplication order requested for the operation.
Combines this matrix with another by adding their translation offsets.
public void Multiply(RadMatrix matrix)
The matrix whose offsets are added.
Resets both translation offsets to zero.
public void Reset()
Attempts to rotate the matrix around the origin; the fixed linear coefficients mean this operation does not rotate transformed points.
public void Rotate(float angle, MatrixOrder order)
The requested rotation angle in degrees.
orderMatrixOrderThe multiplication order used to combine the transform.
Attempts to rotate the matrix around the origin; rotation is not retained by this implementation.
Computes and combines the translation offset for a rotation around the specified point. The requested rotation is not applied to transformed points.
public void RotateAt(float angle, PointF origin, MatrixOrder order)
The requested rotation angle in degrees.
originPointFThe point around which the offset is computed.
orderMatrixOrderThe multiplication order used to combine the offset.
Attempts to scale the matrix; the fixed linear coefficients mean this operation does not scale transformed points.
public void Scale(float scaleX, float scaleY, MatrixOrder order)
The requested horizontal scale.
scaleYfloatThe requested vertical scale.
orderMatrixOrderThe multiplication order used to combine the transform.
Returns a string containing this matrix's translation offsets.
public override string ToString()
The offsets in the form RadMatrix: Offset [DX, DY].
Overrides:
Transforms each point in the array in place by applying this matrix's translation offsets.
Translates the rectangle by applying the matrix offset to its top-left and bottom-right corners.
public RectangleF TransformRectangle(RectangleF bounds)
The rectangle to transform.
Returns:The translated rectangle.
Adds a translation to the matrix; the order does not change the result because only offsets are combined.
public void Translate(float dx, float dy, MatrixOrder order)
The horizontal offset to add.
dyfloatThe vertical offset to add.
orderMatrixOrderThe multiplication order requested for the operation.