PDFsharp-net6

XMatrix

Namespace: PdfSharp.Drawing

Represents a 3-by-3 matrix that represents an affine 2D transformation.

public struct XMatrix

Inheritance ObjectValueTypeXMatrix
Implements IFormattable

Properties

Identity

Gets the identity matrix.

public static XMatrix Identity { get; }

Property Value

XMatrix

IsIdentity

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

public bool IsIdentity { get; }

Property Value

Boolean

Determinant

Gets the determinant of this matrix.

public double Determinant { get; }

Property Value

Double

HasInverse

Gets a value that indicates whether this matrix is invertible.

public bool HasInverse { get; }

Property Value

Boolean

M11

Gets or sets the value of the first row and first column of this matrix.

public double M11 { get; set; }

Property Value

Double

M12

Gets or sets the value of the first row and second column of this matrix.

public double M12 { get; set; }

Property Value

Double

M21

Gets or sets the value of the second row and first column of this matrix.

public double M21 { get; set; }

Property Value

Double

M22

Gets or sets the value of the second row and second column of this matrix.

public double M22 { get; set; }

Property Value

Double

OffsetX

Gets or sets the value of the third row and first column of this matrix.

public double OffsetX { get; set; }

Property Value

Double

OffsetY

Gets or sets the value of the third row and second column of this matrix.

public double OffsetY { get; set; }

Property Value

Double

Constructors

XMatrix(Double, Double, Double, Double, Double, Double)

Initializes a new instance of the XMatrix struct.

XMatrix(double m11, double m12, double m21, double m22, double offsetX, double offsetY)

Parameters

m11 Double

m12 Double

m21 Double

m22 Double

offsetX Double

offsetY Double

Methods

CreateScaling(Double, Double)

XMatrix CreateScaling(double scaleX, double scaleY)

Parameters

scaleX Double

scaleY Double

Returns

XMatrix

CreateScaling(Double, Double, Double, Double)

XMatrix CreateScaling(double scaleX, double scaleY, double centerX, double centerY)

Parameters

scaleX Double

scaleY Double

centerX Double

centerY Double

Returns

XMatrix

CreateSkewRadians(Double, Double, Double, Double)

XMatrix CreateSkewRadians(double skewX, double skewY, double centerX, double centerY)

Parameters

skewX Double

skewY Double

centerX Double

centerY Double

Returns

XMatrix

CreateSkewRadians(Double, Double)

XMatrix CreateSkewRadians(double skewX, double skewY)

Parameters

skewX Double

skewY Double

Returns

XMatrix

SetIdentity()

Sets this matrix into an identity matrix.

void SetIdentity()

GetElements()

Gets an array of double values that represents the elements of this matrix.

Double[] GetElements()

Returns

Double[]

Multiply(XMatrix, XMatrix)

Multiplies two matrices.

XMatrix Multiply(XMatrix trans1, XMatrix trans2)

Parameters

trans1 XMatrix

trans2 XMatrix

Returns

XMatrix

Append(XMatrix)

Appends the specified matrix to this matrix.

void Append(XMatrix matrix)

Parameters

matrix XMatrix

Prepend(XMatrix)

Prepends the specified matrix to this matrix.

void Prepend(XMatrix matrix)

Parameters

matrix XMatrix

Multiply(XMatrix)

Caution

Use Append.


Appends the specified matrix to this matrix.

void Multiply(XMatrix matrix)

Parameters

matrix XMatrix

MultiplyPrepend(XMatrix)

Caution

Use Prepend.


Prepends the specified matrix to this matrix.

void MultiplyPrepend(XMatrix matrix)

Parameters

matrix XMatrix

Multiply(XMatrix, XMatrixOrder)

Multiplies this matrix with the specified matrix.

void Multiply(XMatrix matrix, XMatrixOrder order)

Parameters

matrix XMatrix

order XMatrixOrder

Translate(Double, Double)

Caution

Use TranslateAppend or TranslatePrepend explicitly, because in GDI+ and WPF the defaults are contrary.


Appends a translation of the specified offsets to this matrix.

void Translate(double offsetX, double offsetY)

Parameters

offsetX Double

offsetY Double

TranslateAppend(Double, Double)

Appends a translation of the specified offsets to this matrix.

void TranslateAppend(double offsetX, double offsetY)

Parameters

offsetX Double

offsetY Double

TranslatePrepend(Double, Double)

Prepends a translation of the specified offsets to this matrix.

void TranslatePrepend(double offsetX, double offsetY)

Parameters

offsetX Double

offsetY Double

Translate(Double, Double, XMatrixOrder)

Translates the matrix with the specified offsets.

void Translate(double offsetX, double offsetY, XMatrixOrder order)

Parameters

offsetX Double

offsetY Double

order XMatrixOrder

Scale(Double, Double)

Caution

Use ScaleAppend or ScalePrepend explicitly, because in GDI+ and WPF the defaults are contrary.


Appends the specified scale vector to this matrix.

void Scale(double scaleX, double scaleY)

Parameters

scaleX Double

scaleY Double

ScaleAppend(Double, Double)

Appends the specified scale vector to this matrix.

void ScaleAppend(double scaleX, double scaleY)

Parameters

scaleX Double

scaleY Double

ScalePrepend(Double, Double)

Prepends the specified scale vector to this matrix.

void ScalePrepend(double scaleX, double scaleY)

Parameters

scaleX Double

scaleY Double

Scale(Double, Double, XMatrixOrder)

Scales the matrix with the specified scalars.

void Scale(double scaleX, double scaleY, XMatrixOrder order)

Parameters

scaleX Double

scaleY Double

order XMatrixOrder

Scale(Double)

Caution

Use ScaleAppend or ScalePrepend explicitly, because in GDI+ and WPF the defaults are contrary.


Scales the matrix with the specified scalar.

void Scale(double scaleXY)

Parameters

scaleXY Double

ScaleAppend(Double)

Appends the specified scale vector to this matrix.

void ScaleAppend(double scaleXY)

Parameters

scaleXY Double

ScalePrepend(Double)

Prepends the specified scale vector to this matrix.

void ScalePrepend(double scaleXY)

Parameters

scaleXY Double

Scale(Double, XMatrixOrder)

Scales the matrix with the specified scalar.

void Scale(double scaleXY, XMatrixOrder order)

Parameters

scaleXY Double

order XMatrixOrder

ScaleAt(Double, Double, Double, Double)

Caution

Use ScaleAtAppend or ScaleAtPrepend explicitly, because in GDI+ and WPF the defaults are contrary.


Function is obsolete.

void ScaleAt(double scaleX, double scaleY, double centerX, double centerY)

Parameters

scaleX Double

scaleY Double

centerX Double

centerY Double

ScaleAtAppend(Double, Double, Double, Double)

Appends the specified scale about the specified point of this matrix.

void ScaleAtAppend(double scaleX, double scaleY, double centerX, double centerY)

Parameters

scaleX Double

scaleY Double

centerX Double

centerY Double

ScaleAtPrepend(Double, Double, Double, Double)

Prepends the specified scale about the specified point of this matrix.

void ScaleAtPrepend(double scaleX, double scaleY, double centerX, double centerY)

Parameters

scaleX Double

scaleY Double

centerX Double

centerY Double

Rotate(Double)

Caution

Use RotateAppend or RotatePrepend explicitly, because in GDI+ and WPF the defaults are contrary.


Function is obsolete.

void Rotate(double angle)

Parameters

angle Double

RotateAppend(Double)

Appends a rotation of the specified angle to this matrix.

void RotateAppend(double angle)

Parameters

angle Double

RotatePrepend(Double)

Prepends a rotation of the specified angle to this matrix.

void RotatePrepend(double angle)

Parameters

angle Double

Rotate(Double, XMatrixOrder)

Rotates the matrix with the specified angle.

void Rotate(double angle, XMatrixOrder order)

Parameters

angle Double

order XMatrixOrder

RotateAt(Double, Double, Double)

Caution

Use RotateAtAppend or RotateAtPrepend explicitly, because in GDI+ and WPF the defaults are contrary.


Function is obsolete.

void RotateAt(double angle, double centerX, double centerY)

Parameters

angle Double

centerX Double

centerY Double

RotateAtAppend(Double, Double, Double)

Appends a rotation of the specified angle at the specified point to this matrix.

void RotateAtAppend(double angle, double centerX, double centerY)

Parameters

angle Double

centerX Double

centerY Double

RotateAtPrepend(Double, Double, Double)

Prepends a rotation of the specified angle at the specified point to this matrix.

void RotateAtPrepend(double angle, double centerX, double centerY)

Parameters

angle Double

centerX Double

centerY Double

RotateAt(Double, XPoint)

Caution

Use RotateAtAppend or RotateAtPrepend explicitly, because in GDI+ and WPF the defaults are contrary.


Rotates the matrix with the specified angle at the specified point.

void RotateAt(double angle, XPoint point)

Parameters

angle Double

point XPoint

RotateAtAppend(Double, XPoint)

Appends a rotation of the specified angle at the specified point to this matrix.

void RotateAtAppend(double angle, XPoint point)

Parameters

angle Double

point XPoint

RotateAtPrepend(Double, XPoint)

Prepends a rotation of the specified angle at the specified point to this matrix.

void RotateAtPrepend(double angle, XPoint point)

Parameters

angle Double

point XPoint

RotateAt(Double, XPoint, XMatrixOrder)

Rotates the matrix with the specified angle at the specified point.

void RotateAt(double angle, XPoint point, XMatrixOrder order)

Parameters

angle Double

point XPoint

order XMatrixOrder

Shear(Double, Double)

Caution

Use ShearAppend or ShearPrepend explicitly, because in GDI+ and WPF the defaults are contrary.


Function is obsolete.

void Shear(double shearX, double shearY)

Parameters

shearX Double

shearY Double

ShearAppend(Double, Double)

Appends a skew of the specified degrees in the x and y dimensions to this matrix.

void ShearAppend(double shearX, double shearY)

Parameters

shearX Double

shearY Double

ShearPrepend(Double, Double)

Prepends a skew of the specified degrees in the x and y dimensions to this matrix.

void ShearPrepend(double shearX, double shearY)

Parameters

shearX Double

shearY Double

Shear(Double, Double, XMatrixOrder)

Shears the matrix with the specified scalars.

void Shear(double shearX, double shearY, XMatrixOrder order)

Parameters

shearX Double

shearY Double

order XMatrixOrder

Skew(Double, Double)

Caution

Use SkewAppend or SkewPrepend explicitly, because in GDI+ and WPF the defaults are contrary.


Function is obsolete.

void Skew(double skewX, double skewY)

Parameters

skewX Double

skewY Double

SkewAppend(Double, Double)

Appends a skew of the specified degrees in the x and y dimensions to this matrix.

void SkewAppend(double skewX, double skewY)

Parameters

skewX Double

skewY Double

SkewPrepend(Double, Double)

Prepends a skew of the specified degrees in the x and y dimensions to this matrix.

void SkewPrepend(double skewX, double skewY)

Parameters

skewX Double

skewY Double

Transform(XPoint)

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

XPoint Transform(XPoint point)

Parameters

point XPoint

Returns

XPoint

Transform(XPoint[])

Transforms the specified points by this matrix.

void Transform(XPoint[] points)

Parameters

points XPoint[]

TransformPoints(XPoint[])

Multiplies all points of the specified array with this matrix.

void TransformPoints(XPoint[] points)

Parameters

points XPoint[]

Transform(XVector)

Transforms the specified vector by this Matrix and returns the result.

XVector Transform(XVector vector)

Parameters

vector XVector

Returns

XVector

Transform(XVector[])

Transforms the specified vectors by this matrix.

void Transform(XVector[] vectors)

Parameters

vectors XVector[]

Invert()

Inverts the matrix.

void Invert()

Equals(XMatrix, XMatrix)

Determines whether the two matrices are equal.

bool Equals(XMatrix matrix1, XMatrix matrix2)

Parameters

matrix1 XMatrix

matrix2 XMatrix

Returns

Boolean

Equals(Object)

Determines whether this matrix is equal to the specified object.

bool Equals(object o)

Parameters

o Object

Returns

Boolean

Equals(XMatrix)

Determines whether this matrix is equal to the specified matrix.

bool Equals(XMatrix value)

Parameters

value XMatrix

Returns

Boolean

GetHashCode()

Returns the hash code for this instance.

int GetHashCode()

Returns

Int32

Parse(String)

Parses a matrix from a string.

XMatrix Parse(string source)

Parameters

source String

Returns

XMatrix

ToString()

Converts this XMatrix to a human readable string.

string ToString()

Returns

String

ToString(IFormatProvider)

Converts this XMatrix to a human readable string.

string ToString(IFormatProvider provider)

Parameters

provider IFormatProvider

Returns

String

ConvertToString(String, IFormatProvider)

string ConvertToString(string format, IFormatProvider provider)

Parameters

format String

provider IFormatProvider

Returns

String

MultiplyVector(Double&, Double&)

void MultiplyVector(Double& x, Double& y)

Parameters

x Double&

y Double&

MultiplyPoint(Double&, Double&)

void MultiplyPoint(Double& x, Double& y)

Parameters

x Double&

y Double&

CreateTranslation(Double, Double)

XMatrix CreateTranslation(double offsetX, double offsetY)

Parameters

offsetX Double

offsetY Double

Returns

XMatrix

CreateRotationRadians(Double)

XMatrix CreateRotationRadians(double angle)

Parameters

angle Double

Returns

XMatrix

CreateRotationRadians(Double, Double, Double)

XMatrix CreateRotationRadians(double angle, double centerX, double centerY)

Parameters

angle Double

centerX Double

centerY Double

Returns

XMatrix