<PackageReference Include="System.Drawing.Common" Version="8.0.13" />

Matrix

public sealed class Matrix : MarshalByRefObject, IDisposable
Encapsulates a 3-by-3 affine matrix that represents a geometric transform. This class cannot be inherited.
public float[] Elements { get; }

Gets an array of floating-point values that represents the elements of this Matrix.

public bool IsIdentity { get; }

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

public bool IsInvertible { get; }

Gets a value indicating whether this Matrix is invertible.

public float OffsetX { get; }

Gets the x translation value (the dx value, or the element in the third row and first column) of this Matrix.

public float OffsetY { get; }

Gets the y translation value (the dy value, or the element in the third row and second column) of this Matrix.

public Matrix()

Initializes a new instance of the Matrix class as the identity matrix.

public Matrix(Rectangle rect, Point[] plgpts)

Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points.

public Matrix(RectangleF rect, PointF[] plgpts)

Initializes a new instance of the Matrix class to the geometric transform defined by the specified rectangle and array of points.

public Matrix(float m11, float m12, float m21, float m22, float dx, float dy)

Initializes a new instance of the Matrix class with the specified elements.

public Matrix Clone()

Creates an exact copy of this Matrix.

public void Dispose()

Releases all resources used by this Matrix.

public void Invert()

Inverts this Matrix, if it is invertible.

public void Multiply(Matrix matrix)

Multiplies this Matrix by the matrix specified in the matrix parameter, by prepending the specified Matrix.

public void Multiply(Matrix matrix, MatrixOrder order)

Multiplies this Matrix by the matrix specified in the matrix parameter, and in the order specified in the order parameter.

public void Reset()

Resets this Matrix to have the elements of the identity matrix.

public void Rotate(float angle)

Prepend to this Matrix a clockwise rotation, around the origin and by the specified angle.

public void Rotate(float angle, MatrixOrder order)

Applies a clockwise rotation of an amount specified in the angle parameter, around the origin (zero x and y coordinates) for this Matrix.

public void RotateAt(float angle, PointF point)

Applies a clockwise rotation to this Matrix around the point specified in the point parameter, and by prepending the rotation.

public void RotateAt(float angle, PointF point, MatrixOrder order)

Applies a clockwise rotation about the specified point to this Matrix in the specified order.

public void Scale(float scaleX, float scaleY)

Applies the specified scale vector to this Matrix by prepending the scale vector.

public void Scale(float scaleX, float scaleY, MatrixOrder order)

Applies the specified scale vector (scaleX and scaleY) to this Matrix using the specified order.

public void Shear(float shearX, float shearY)

Applies the specified shear vector to this Matrix by prepending the shear transformation.

public void Shear(float shearX, float shearY, MatrixOrder order)

Applies the specified shear vector to this Matrix in the specified order.

public void TransformPoints(PointF[] pts)

Applies the geometric transform represented by this Matrix to a specified array of points.

public void TransformPoints(Point[] pts)

Applies the geometric transform represented by this Matrix to a specified array of points.

public void TransformVectors(PointF[] pts)

Multiplies each vector in an array by the matrix. The translation elements of this matrix (third row) are ignored.

public void TransformVectors(Point[] pts)

Applies only the scale and rotate components of this Matrix to the specified array of points.

public void Translate(float offsetX, float offsetY)

Applies the specified translation vector (offsetX and offsetY) to this Matrix by prepending the translation vector.

public void Translate(float offsetX, float offsetY, MatrixOrder order)

Applies the specified translation vector to this Matrix in the specified order.

public void VectorTransformPoints(Point[] pts)

Multiplies each vector in an array by the matrix. The translation elements of this matrix (third row) are ignored.