Matrix Constructors

Definition

Initializes a new instance of the Matrix class.

Overloads

Matrix()

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

Matrix(Matrix3x2)

Constructs a Matrix utilizing the specified matrix.

Matrix(Rectangle, Point[])

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

Matrix(RectangleF, PointF[])

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

Matrix(Single, Single, Single, Single, Single, Single)

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

Matrix()

Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs

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

C#
public Matrix();

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Matrix(Matrix3x2)

Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs

Constructs a Matrix utilizing the specified matrix.

C#
public Matrix(System.Numerics.Matrix3x2 matrix);

Parameters

matrix
Matrix3x2

Matrix data to construct from.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
Windows Desktop 6, 7, 8, 9

Matrix(Rectangle, Point[])

Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs

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

C#
public Matrix(System.Drawing.Rectangle rect, params System.Drawing.Point[] plgpts);
C#
public Matrix(System.Drawing.Rectangle rect, System.Drawing.Point[] plgpts);

Parameters

rect
Rectangle

A Rectangle structure that represents the rectangle to be transformed.

plgpts
Point[]

An array of three Point structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners of the rectangle is to be transformed. The lower-right corner of the parallelogram is implied by the first three corners.

Remarks

This method initializes the new Matrix such that it represents the geometric transform that maps the rectangle specified by the rect parameter to the parallelogram defined by the three points in the plgpts parameter. The upper-left corner of the rectangle is mapped to the first point in the plgpts array, the upper-right corner is mapped to the second point, and the lower-left corner is mapped to the third point. The lower-right point of the parallelogram is implied by the first three.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Matrix(RectangleF, PointF[])

Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs

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

C#
public Matrix(System.Drawing.RectangleF rect, params System.Drawing.PointF[] plgpts);
C#
public Matrix(System.Drawing.RectangleF rect, System.Drawing.PointF[] plgpts);

Parameters

rect
RectangleF

A RectangleF structure that represents the rectangle to be transformed.

plgpts
PointF[]

An array of three PointF structures that represents the points of a parallelogram to which the upper-left, upper-right, and lower-left corners of the rectangle is to be transformed. The lower-right corner of the parallelogram is implied by the first three corners.

Remarks

This method initializes the new Matrix such that it represents the geometric transform that maps the rectangle specified by the rect parameter to the parallelogram defined by the three points in the plgpts parameter. The upper-left corner of the rectangle is mapped to the first point in the plgpts array, the upper-right corner is mapped to the second point, and the lower-left corner is mapped to the third point. The lower-right point of the parallelogram is implied by the first three.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Matrix(Single, Single, Single, Single, Single, Single)

Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs
Source:
Matrix.cs

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

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

Parameters

m11
Single

The value in the first row and first column of the new Matrix.

m12
Single

The value in the first row and second column of the new Matrix.

m21
Single

The value in the second row and first column of the new Matrix.

m22
Single

The value in the second row and second column of the new Matrix.

dx
Single

The value in the third row and first column of the new Matrix.

dy
Single

The value in the third row and second column of the new Matrix.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9