New to Telerik UI for WPFStart a free 30-day trial

RadMatrix

Struct

Represents a light-weight 3*3 Matrix to be used for GDI+ transformations.

Definition

Namespace:Telerik.Windows.Documents.Layout

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
public struct RadMatrix

Constructors

Initializes a new RadMatrix, using the specified parameters.

C#
public RadMatrix(float m11, float m12, float m21, float m22, float dx, float dy)
Parameters:m11floatm12floatm21floatm22floatdxfloatdyfloat

Initializes a new RadMatrix, scaling it by the provided parameters, at the specified origin.

C#
public RadMatrix(float scaleX, float scaleY, PointF origin)
Parameters:scaleXfloatscaleYfloatoriginPointF

Initializes a new RadMatrix, scaling it by the provided parameters, at the origin (0, 0).

C#
public RadMatrix(float scaleX, float scaleY)
Parameters:scaleXfloatscaleYfloat

Initializes a new RadMatrix, rotated by the specified angle (in degrees) at the provided origin.

C#
public RadMatrix(float angle, PointF origin)
Parameters:anglefloatoriginPointF

Initializes a new RadMatrix, rotated by the specified angle (in degrees) at origin (0, 0).

C#
public RadMatrix(float angle)
Parameters:anglefloat

Initializes a new RadMatrix, applying the specified X and Y values as DX and DY members of the matrix.

C#
public RadMatrix(PointF offset)
Parameters:offsetPointF

Copy constructor.

C#
public RadMatrix(RadMatrix source)
Parameters:sourceRadMatrix

Fields

C#
public const float DegreeToRadian = 0.017453294
C#
public float DX
C#
public float DY
C#
public static readonly RadMatrix Empty
C#
public static readonly RadMatrix Identity
C#
public static readonly float M11
C#
public static readonly float M12
C#
public static readonly float M21
C#
public static readonly float M22
C#
public const float PI = 3.141593
C#
public const float RadianToDegree = 57.295773
C#
public const float TwoPI = 6.283186

Properties

Gets the determinant - [(M11 * M22) - (M12 * M21)] - of this Matrix.

C#
public float Determinant { get; }

Gets all the six fields of the matrix as an array.

C#
public float[] Elements { get; }

Determines whether the current matrix is empty.

C#
public bool IsEmpty { get; }

Determines whether this matrix equals to the Identity one.

C#
public bool IsIdentity { get; }

Determines whether this matrix may be inverted. That is to have non-zero determinant.

C#
public bool IsInvertible { get; }

Gets the rotation (in degrees) applied to this matrix.

C#
public float Rotation { get; }

Gets the scale by the X axis, provided by this matrix.

C#
public float ScaleX { get; }

Gets the scale by the Y axis, provided by this matrix.

C#
public float ScaleY { get; }

Methods

Determines whether the specified array of floating-point values is equal to the current instance of the RadMatrix.

C#
public bool Equals(float[] elements)
Parameters:elementsfloat[]

An array of floating-point values to compare with the current RadMatrix instance.

Returns:

bool

true if the specified array is equal to the current RadMatrix; otherwise, false.

Determines whether the specified object is equal to the current instance of RadMatrix.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with the current RadMatrix instance.

Returns:

bool

true if the specified object is equal to the current RadMatrix instance; otherwise, false.

Overrides: ValueType.Equals(object)

Computes the hash code for the current instance of the RadMatrix class.

C#
public override int GetHashCode()
Returns:

int

A 32-bit signed integer that represents the hash code of the current RadMatrix instance.

Overrides: ValueType.GetHashCode()

Multiplies the current RadMatrix by another RadMatrix using the specified order of multiplication.

C#
public void Multiply(RadMatrix matrix, MatrixOrder order)
Parameters:matrixRadMatrix

The RadMatrix to be multiplied with the current matrix.

orderMatrixOrder

The order in which the multiplication is to be performed.

Multiplies the current instance of the RadMatrix with another RadMatrix.

C#
public void Multiply(RadMatrix matrix)
Parameters:matrixRadMatrix

The RadMatrix to multiply with the current instance.

Calculates the distance between two points in a 2D space.

C#
public static float PointsDistance(PointF point1, PointF point2)
Parameters:point1PointF

The first point represented as a PointF structure.

point2PointF

The second point represented as a PointF structure.

Returns:

float

The distance between the two points as a double value.

Resets the matrix to its initial state, clearing any transformations or modifications applied.

C#
public void Reset()

Rotates the matrix by the specified angle.

C#
public void Rotate(float angle, MatrixOrder order)
Parameters:anglefloat

The angle in degrees to rotate the matrix.

orderMatrixOrder

Specifies the order of the transformation, indicating whether to apply the rotation before or after any other transformations.

Rotates the matrix by the specified angle.

C#
public void Rotate(float angle)
Parameters:anglefloat

The angle in degrees to rotate the matrix.

Rotates the matrix at a specified angle around a given point, applying the specified order for the transformation.

C#
public void RotateAt(float angle, PointF origin, MatrixOrder order)
Parameters:anglefloat

The angle in degrees to rotate the matrix.

originPointF

The point around which the rotation occurs.

orderMatrixOrder

The order in which the rotation operation is applied to the matrix.

Rotates the matrix at the specified angle around a specified point.

C#
public void RotateAt(float angle, PointF origin)
Parameters:anglefloat

The angle in degrees to rotate the matrix.

originPointF

The point around which the matrix will be rotated.

Scales the matrix by the specified horizontal and vertical factors in accordance with the provided matrix order.

C#
public void Scale(float scaleX, float scaleY, MatrixOrder order)
Parameters:scaleXfloat

The horizontal scaling factor.

scaleYfloat

The vertical scaling factor.

orderMatrixOrder

The order in which the transformations are applied.

Scales the matrix by the specified factors along the X and Y axes.

C#
public void Scale(float scaleX, float scaleY)
Parameters:scaleXfloat

The factor by which to scale the matrix along the X axis.

scaleYfloat

The factor by which to scale the matrix along the Y axis.

Returns a string representation of the current instance of the RadMatrix class.

C#
public override string ToString()
Returns:

string

A string that describes the contents and dimensions of the RadMatrix instance.

Overrides: ValueType.ToString()

Transforms the specified point using the current transformation matrix.

C#
public PointF TransformPoint(PointF point)
Parameters:pointPointF

The point to be transformed.

Returns:

PointF

Returns a new PointF that represents the transformed coordinates of the specified point.

Transforms an array of 2D points using the current transformation matrix.

C#
public void TransformPoints(PointF[] points)
Parameters:pointsPointF[]

An array of PointF structures representing the points to be transformed.

Transforms the specified rectangle using the RadMatrix transformation.

C#
public RectangleF TransformRectangle(RectangleF bounds)
Parameters:boundsRectangleF

The rectangle to be transformed.

Returns:

RectangleF

A new RectangleF that represents the transformed rectangle.

Translates the matrix by the specified x and y offsets according to the given matrix order.

C#
public void Translate(float dx, float dy, MatrixOrder order)
Parameters:dxfloat

The amount to translate along the x-axis.

dyfloat

The amount to translate along the y-axis.

orderMatrixOrder

The order in which the translation is to be applied.

Translates the matrix by the specified X and Y offsets.

C#
public void Translate(float dx, float dy)
Parameters:dxfloat

The offset in the X direction.

dyfloat

The offset in the Y direction.

Operators

C#
public static bool operator !=(RadMatrix matrix1, RadMatrix matrix2)
Parameters:matrix1RadMatrixmatrix2RadMatrixReturns:

bool

C#
public static RadMatrix operator *(RadMatrix matrix1, RadMatrix matrix2)
Parameters:matrix1RadMatrixmatrix2RadMatrixReturns:

RadMatrix

C#
public static bool operator ==(RadMatrix matrix1, RadMatrix matrix2)
Parameters:matrix1RadMatrixmatrix2RadMatrixReturns:

bool