Matrix Struct

Definition

Represents a 3x3 affine transformation matrix used for 2D transformations such as rotation, scaling, skewing, and translation.

public value class Matrix : IEquatable<Microsoft::Maui::Controls::Shapes::Matrix>
[System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.Controls.Shapes.MatrixTypeConverter))]
public struct Matrix : IEquatable<Microsoft.Maui.Controls.Shapes.Matrix>
[<System.ComponentModel.TypeConverter(typeof(Microsoft.Maui.Controls.Shapes.MatrixTypeConverter))>]
type Matrix = struct
Public Structure Matrix
Implements IEquatable(Of Matrix)
Inheritance
Matrix
Attributes
Implements

Constructors

Name Description
Matrix(Double, Double, Double, Double, Double, Double)

Initializes a new Matrix with the specified values.

Properties

Name Description
Determinant

Gets the determinant of this matrix.

HasInverse

Gets a value indicating whether this matrix has an inverse (determinant is non-zero).

Identity

Gets the identity matrix.

IsIdentity

Gets a value indicating whether this matrix is the identity matrix.

M11

Gets or sets the value at row 1, column 1 of the matrix (horizontal scale component).

M12

Gets or sets the value at row 1, column 2 of the matrix.

M21

Gets or sets the value at row 2, column 1 of the matrix.

M22

Gets or sets the value at row 2, column 2 of the matrix (vertical scale component).

OffsetX

Gets or sets the X translation offset of the matrix.

OffsetY

Gets or sets the Y translation offset of the matrix.

Methods

Name Description
Append(Matrix)

Appends the specified matrix to this matrix.

Equals(Matrix)
Equals(Object)
GetHashCode()
Invert()

Inverts this matrix if it is invertible.

Multiply(Matrix, Matrix)

Multiplies two matrices and returns the result.

Prepend(Matrix)

Prepends the specified matrix to this matrix.

Rotate(Double)

Appends a rotation transformation to this matrix.

RotateAt(Double, Double, Double)

Appends a rotation transformation around the specified point to this matrix.

RotateAtPrepend(Double, Double, Double)

Prepends a rotation transformation around the specified point to this matrix.

RotatePrepend(Double)

Prepends a rotation transformation to this matrix.

Scale(Double, Double)

Appends a scale transformation to this matrix.

ScaleAt(Double, Double, Double, Double)

Appends a scale transformation around the specified point to this matrix.

ScaleAtPrepend(Double, Double, Double, Double)

Prepends a scale transformation around the specified point to this matrix.

ScalePrepend(Double, Double)

Prepends a scale transformation to this matrix.

SetIdentity()

Sets this matrix to the identity matrix.

Skew(Double, Double)

Appends a skew transformation to this matrix.

SkewPrepend(Double, Double)

Prepends a skew transformation to this matrix.

Transform(Point)

Transforms the specified point by this matrix and returns the result.

Transform(Point[])

Transforms the specified array of points by this matrix.

Translate(Double, Double)

Appends a translation transformation to this matrix.

TranslatePrepend(Double, Double)

Prepends a translation transformation to this matrix.

Operators

Name Description
Equality(Matrix, Matrix)
Inequality(Matrix, Matrix)
Multiply(Matrix, Matrix)

Extension Methods

Name Description
ToMatrix3X2(Matrix)

Applies to