Struct Matrix
Represents a 3x3 affine transformation matrix used for transformations in two-dimensional space.
Implements
Inherited Members
Namespace: System.Windows.Media
Assembly: OpenSilver.dll
Syntax
public struct Matrix : IFormattable
Constructors
| Improve this Doc View SourceMatrix(Double, Double, Double, Double, Double, Double)
Initializes a Matrix structure.
Declaration
public Matrix(double m11, double m12, double m21, double m22, double offsetX, double offsetY)
Parameters
Type | Name | Description |
---|---|---|
System.Double | m11 | |
System.Double | m12 | |
System.Double | m21 | |
System.Double | m22 | |
System.Double | offsetX | |
System.Double | offsetY |
Properties
| Improve this Doc View SourceIdentity
Gets an identity Matrix.
Declaration
public static readonly Matrix Identity { get; }
Property Value
Type | Description |
---|---|
Matrix |
IsIdentity
Gets a value that indicates whether this Matrix structure is an identity matrix.
Declaration
public readonly bool IsIdentity { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
M11
Gets or sets the value of the first row and first column of this Matrix structure. The default value is 1.
Declaration
public double M11 { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
M12
Gets or sets the value of the first row and second column of this Matrix structure. The default value is 0.
Declaration
public double M12 { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
M21
Gets or sets the value of the second row and first column of this Matrix structure. The default value is 0.
Declaration
public double M21 { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
M22
Gets or sets the value of the second row and second column of this Matrix structure. The default value is 1.
Declaration
public double M22 { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
OffsetX
Gets or sets the value of the third row and first column of this Matrix structure. The default value is 0.
Declaration
public double OffsetX { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
OffsetY
Gets or sets the value of the third row and second column of this Matrix structure. The default value is 0.
Declaration
public double OffsetY { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceEquals(Object)
Determines whether the specified System.Object is a Matrix structure that is identical to this Matrix.
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
System.Object | o | The System.Object to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if o is a Matrix structure that is identical to this Matrix structure; otherwise, false. |
Overrides
Equals(Matrix)
Determines whether the specified Matrix structure is identical to this instance.
Declaration
public bool Equals(Matrix value)
Parameters
Type | Name | Description |
---|---|---|
Matrix | value | The instance of Matrix to compare to this instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if instances are equal; otherwise, false. |
GetHashCode()
Returns the hash code for this Matrix structure.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code for this instance. |
Overrides
Parse(String)
Parse - returns an instance converted from the provided string using the culture "en-US"
string with Matrix dataDeclaration
public static Matrix Parse(string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | source |
Returns
Type | Description |
---|---|
Matrix |
ToString()
Creates a System.String representation of this Matrix structure.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String containing the M11, M12, M21, M22, OffsetX, and OffsetY values of this Matrix. |
Overrides
ToString(IFormatProvider)
Creates a System.String representation of this Matrix structure with culture-specific formatting information.
Declaration
public string ToString(IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | provider | The culture-specific formatting information. |
Returns
Type | Description |
---|---|
System.String | A System.String containing the M11, M12, M21, M22, OffsetX, and OffsetY values of this Matrix. |
Transform(Point)
Transforms the specified point by the Matrix and returns the result.
Declaration
public Point Transform(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | The point to transform. |
Returns
Type | Description |
---|---|
Point | The result of transforming point by this Matrix. |
Operators
| Improve this Doc View SourceEquality(Matrix, Matrix)
Declaration
public static bool operator ==(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | |
Matrix | matrix2 |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(Matrix, Matrix)
Declaration
public static bool operator !=(Matrix matrix1, Matrix matrix2)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix1 | |
Matrix | matrix2 |
Returns
Type | Description |
---|---|
System.Boolean |
Explicit Interface Implementations
| Improve this Doc View SourceIFormattable.ToString(String, IFormatProvider)
Declaration
string IFormattable.ToString(string format, IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | |
System.IFormatProvider | provider |
Returns
Type | Description |
---|---|
System.String |