Struct
RadMatrix

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:

cs-api-definition
public struct RadMatrix

Constructors

RadMatrix(PointF)

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

Declaration

cs-api-definition
public RadMatrix(PointF offset)

Parameters

offset

PointF

RadMatrix(RadMatrix)

Copy constructor.

Declaration

cs-api-definition
public RadMatrix(RadMatrix source)

Parameters

source

RadMatrix

RadMatrix(float)

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

Declaration

cs-api-definition
public RadMatrix(float angle)

Parameters

angle

float

RadMatrix(float, PointF)

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

Declaration

cs-api-definition
public RadMatrix(float angle, PointF origin)

Parameters

angle

float

origin

PointF

RadMatrix(float, float)

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

Declaration

cs-api-definition
public RadMatrix(float scaleX, float scaleY)

Parameters

scaleX

float

scaleY

float

RadMatrix(float, float, PointF)

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

Declaration

cs-api-definition
public RadMatrix(float scaleX, float scaleY, PointF origin)

Parameters

scaleX

float

scaleY

float

origin

PointF

RadMatrix(float, float, float, float, float, float)

Initializes a new RadMatrix, using the specified parameters.

Declaration

cs-api-definition
public RadMatrix(float m11, float m12, float m21, float m22, float dx, float dy)

Parameters

m11

float

m12

float

m21

float

m22

float

dx

float

dy

float

Fields

DX

Declaration

cs-api-definition
public float DX

Field Value

float

DY

Declaration

cs-api-definition
public float DY

Field Value

float

DegreeToRadian

Declaration

cs-api-definition
public const float DegreeToRadian = 0.017453294

Field Value

float

Empty

Declaration

cs-api-definition
public static readonly RadMatrix Empty

Field Value

RadMatrix

Identity

Declaration

cs-api-definition
public static readonly RadMatrix Identity

Field Value

RadMatrix

M11

Declaration

cs-api-definition
public static readonly float M11

Field Value

float

M12

Declaration

cs-api-definition
public static readonly float M12

Field Value

float

M21

Declaration

cs-api-definition
public static readonly float M21

Field Value

float

M22

Declaration

cs-api-definition
public static readonly float M22

Field Value

float

PI

Declaration

cs-api-definition
public const float PI = 3.141593

Field Value

float

RadianToDegree

Declaration

cs-api-definition
public const float RadianToDegree = 57.295773

Field Value

float

TwoPI

Declaration

cs-api-definition
public const float TwoPI = 6.283186

Field Value

float

Properties

Determinant

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

Declaration

cs-api-definition
public float Determinant { get; }

Property Value

float

Elements

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

Declaration

cs-api-definition
public float[] Elements { get; }

Property Value

float[]

IsEmpty

Determines whether the current matrix is empty.

Declaration

cs-api-definition
public bool IsEmpty { get; }

Property Value

bool

IsIdentity

Determines whether this matrix equals to the Identity one.

Declaration

cs-api-definition
public bool IsIdentity { get; }

Property Value

bool

IsInvertible

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

Declaration

cs-api-definition
public bool IsInvertible { get; }

Property Value

bool

Rotation

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

Declaration

cs-api-definition
public float Rotation { get; }

Property Value

float

ScaleX

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

Declaration

cs-api-definition
public float ScaleX { get; }

Property Value

float

ScaleY

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

Declaration

cs-api-definition
public float ScaleY { get; }

Property Value

float

Methods

Equals(float[])

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

Declaration

cs-api-definition
public bool Equals(float[] elements)

Parameters

elements

float[]

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.

Equals(object)

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

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

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)

GetHashCode()

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

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

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

Overrides ValueType.GetHashCode()

Multiply(RadMatrix)

Multiplies the current instance of the RadMatrix with another RadMatrix.

Declaration

cs-api-definition
public void Multiply(RadMatrix matrix)

Parameters

matrix

RadMatrix

The RadMatrix to multiply with the current instance.

Multiply(RadMatrix, MatrixOrder)

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

Declaration

cs-api-definition
public void Multiply(RadMatrix matrix, MatrixOrder order)

Parameters

matrix

RadMatrix

The RadMatrix to be multiplied with the current matrix.

order

MatrixOrder

The order in which the multiplication is to be performed.

PointsDistance(PointF, PointF)

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

Declaration

cs-api-definition
public static float PointsDistance(PointF point1, PointF point2)

Parameters

point1

PointF

The first point represented as a PointF structure.

point2

PointF

The second point represented as a PointF structure.

Returns

float

The distance between the two points as a double value.

Reset()

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

Declaration

cs-api-definition
public void Reset()

Rotate(float)

Rotates the matrix by the specified angle.

Declaration

cs-api-definition
public void Rotate(float angle)

Parameters

angle

float

The angle in degrees to rotate the matrix.

Rotate(float, MatrixOrder)

Rotates the matrix by the specified angle.

Declaration

cs-api-definition
public void Rotate(float angle, MatrixOrder order)

Parameters

angle

float

The angle in degrees to rotate the matrix.

order

MatrixOrder

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

RotateAt(float, PointF)

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

Declaration

cs-api-definition
public void RotateAt(float angle, PointF origin)

Parameters

angle

float

The angle in degrees to rotate the matrix.

origin

PointF

The point around which the matrix will be rotated.

RotateAt(float, PointF, MatrixOrder)

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

Declaration

cs-api-definition
public void RotateAt(float angle, PointF origin, MatrixOrder order)

Parameters

angle

float

The angle in degrees to rotate the matrix.

origin

PointF

The point around which the rotation occurs.

order

MatrixOrder

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

Scale(float, float)

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

Declaration

cs-api-definition
public void Scale(float scaleX, float scaleY)

Parameters

scaleX

float

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

scaleY

float

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

Scale(float, float, MatrixOrder)

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

Declaration

cs-api-definition
public void Scale(float scaleX, float scaleY, MatrixOrder order)

Parameters

scaleX

float

The horizontal scaling factor.

scaleY

float

The vertical scaling factor.

order

MatrixOrder

The order in which the transformations are applied.

ToString()

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

Declaration

cs-api-definition
public override string ToString()

Returns

string

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

Overrides ValueType.ToString()

TransformPoint(PointF)

Transforms the specified point using the current transformation matrix.

Declaration

cs-api-definition
public PointF TransformPoint(PointF point)

Parameters

point

PointF

The point to be transformed.

Returns

PointF

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

TransformPoints(PointF[])

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

Declaration

cs-api-definition
public void TransformPoints(PointF[] points)

Parameters

points

PointF[]

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

TransformRectangle(RectangleF)

Transforms the specified rectangle using the RadMatrix transformation.

Declaration

cs-api-definition
public RectangleF TransformRectangle(RectangleF bounds)

Parameters

bounds

RectangleF

The rectangle to be transformed.

Returns

RectangleF

A new RectangleF that represents the transformed rectangle.

Translate(float, float)

Translates the matrix by the specified X and Y offsets.

Declaration

cs-api-definition
public void Translate(float dx, float dy)

Parameters

dx

float

The offset in the X direction.

dy

float

The offset in the Y direction.

Translate(float, float, MatrixOrder)

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

Declaration

cs-api-definition
public void Translate(float dx, float dy, MatrixOrder order)

Parameters

dx

float

The amount to translate along the x-axis.

dy

float

The amount to translate along the y-axis.

order

MatrixOrder

The order in which the translation is to be applied.

Operators

operator !=(RadMatrix, RadMatrix)

Declaration

cs-api-definition
public static bool operator !=(RadMatrix matrix1, RadMatrix matrix2)

Parameters

matrix1

RadMatrix

matrix2

RadMatrix

Returns

bool

operator *(RadMatrix, RadMatrix)

Declaration

cs-api-definition
public static RadMatrix operator *(RadMatrix matrix1, RadMatrix matrix2)

Parameters

matrix1

RadMatrix

matrix2

RadMatrix

Returns

RadMatrix

operator ==(RadMatrix, RadMatrix)

Declaration

cs-api-definition
public static bool operator ==(RadMatrix matrix1, RadMatrix matrix2)

Parameters

matrix1

RadMatrix

matrix2

RadMatrix

Returns

bool