PdfMatrix Struct
Represents a 3x3 affine transformation matrix used for transformations in PDF 2-D space.
public struct PdfMatrix : IEquatable<PdfMatrix>
Public Structure PdfMatrix
Implements IEquatable(Of PdfMatrix)
Implements
Constructors
PdfMatrix(Double, Double, Double, Double, Double, Double)
Initializes a new instance of the PdfMatrix structure.
public PdfMatrix(double m11, double m12, double m21, double m22, double offsetX, double offsetY)
Public Sub New(m11 As Double, m12 As Double, m21 As Double, m22 As Double, offsetX As Double, offsetY As Double)
Parameters
m11
- System.Double
The value of the first row and first column of the new PdfMatrix structure.
m12
- System.Double
The value of the first row and second column of the new PdfMatrix structure.
m21
- System.Double
The value of the second row and first column of the new PdfMatrix structure.
m22
- System.Double
The value of the second row and second column of the new PdfMatrix structure.
offsetX
- System.Double
The value of the third row and first column of the new PdfMatrix structure.
offsetY
- System.Double
The value of the third row and second column of the new PdfMatrix structure.
Properties
Identity
Gets an identity PdfMatrix.
public static readonly PdfMatrix Identity { get; }
Public Shared ReadOnly Property Identity As PdfMatrix
Property Value
An identity matrix.
IsIdentity
Gets a value that indicates whether this PdfMatrix structure is an identity matrix.
Property Value
- System.Boolean
true if the PdfMatrix structure is an identity matrix; otherwise, false. The default is true.
M11
Gets the value of the first row and first column of this PdfMatrix structure.
The default value is 1.
Property Value
- System.Double
The value of the first row and first column of this PdfMatrix.
M12
Gets the value of the first row and second column of this PdfMatrix structure.
The default value is 0.
Property Value
- System.Double
The value of the first row and second column of this PdfMatrix.
M21
Gets the value of the second row and first column of this PdfMatrix structure.
The default value is 1.
Property Value
- System.Double
The value of the second row and first column of this PdfMatrix.
M22
Gets the value of the second row and second column of this PdfMatrix structure.
The default value is 1.
Property Value
- System.Double
The value of the second row and second column of this PdfMatrix.
OffsetX
Gets the value of the third row and first column of this PdfMatrix structure.
The default value is 0.
Property Value
- System.Double
The value of the third row and first column of this PdfMatrix.
OffsetY
Gets the value of the third row and second column of this PdfMatrix structure.
The default value is 0.
Property Value
- System.Double
The value of the third row and second column of this PdfMatrix.
Methods
CreateTranslation(Double, Double)
Creates a translation PdfMatrix with the specified offsets.
public static PdfMatrix CreateTranslation(double offsetX, double offsetY)
Public Shared Function CreateTranslation(offsetX As Double, offsetY As Double) As PdfMatrix
Parameters
offsetX
- System.Double
The amount to offset along the x-axis.
offsetY
- System.Double
The amount to offset along the y-axis.
Returns
Equals(PdfMatrix)
Parameters
other
- PdfMatrix
The other matrix to compare with this matrix instance.
Returns
Equals(Object)
Determines whether the specified System.Object is equal to this PdfMatrix instance.
public override bool Equals(object obj)
Public Overrides Function Equals(obj As Object) As Boolean
Parameters
obj
- System.Object
The System.Object to compare with this matrix instance.
Returns
- System.Boolean
Overrides
GetHashCode()
Returns a hash code for this PdfMatrix instance.
Returns
- System.Int32
An integer value that specifies a hash value for this PdfMatrix instance.
Overrides
Invert()
Inverts this PdfMatrix structure.
Returns
- System.Boolean
Multiply(PdfMatrix, PdfMatrix)
Premultiplies the PdfMatrix representing the additional transformation with the PdfMatrix representing the existing transformation, thus producing the PdfMatrix representing the combined transformation.
public static PdfMatrix Multiply(PdfMatrix additionalTransform, PdfMatrix existingTransform)
Public Shared Function Multiply(additionalTransform As PdfMatrix, existingTransform As PdfMatrix) As PdfMatrix
Parameters
additionalTransform
- PdfMatrix
The additional transformation.
existingTransform
- PdfMatrix
The existing transformation.
Returns
The combined transformation composed of the existingTransform
and the additionalTransform
.
Rotate(Double, Double, Double)
Prepends a rotation of the specified angle at the specified point to this PdfMatrix structure.
public void Rotate(double angle, double centerX = 0, double centerY = 0)
Public Sub Rotate(angle As Double, centerX As Double = 0, centerY As Double = 0)
Parameters
angle
- System.Double
The rotation angle, in degrees, of counter clockwise rotation.
centerX
- System.Double
The x-coordinate of the rotation center.
centerY
- System.Double
The y-coordinate of the rotation center.
Scale(Double, Double, Double, Double)
Prepends the specified scale about the specified point of this PdfMatrix.
public void Scale(double scaleX, double scaleY, double centerX = 0, double centerY = 0)
Public Sub Scale(scaleX As Double, scaleY As Double, centerX As Double = 0, centerY As Double = 0)
Parameters
scaleX
- System.Double
The x-axis scale factor.
scaleY
- System.Double
The y-axis scale factor.
centerX
- System.Double
The x-coordinate of the point about which the scale operation is performed.
centerY
- System.Double
The y-coordinate of the point about which the scale operation is performed.
ToString()
Returns a System.String that represents this PdfMatrix instance.
Returns
- System.String
A System.String that represents this PdfMatrix instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
Transform(PdfPoint)
public PdfPoint Transform(PdfPoint point)
Public Function Transform(point As PdfPoint) As PdfPoint
Parameters
point
- PdfPoint
The point to transform.
Returns
The transformed point
.
Transform(ref PdfQuad)
Parameters
quad
- PdfQuad
The quadrilateral to transform.
Remarks
This method passes PdfQuad instance by-reference because it is transformed in-place to avoid excessive by-value copying.
Translate(Double, Double)
Prepends a translation of the specified offsets to this PdfMatrix structure.
public void Translate(double offsetX, double offsetY)
Public Sub Translate(offsetX As Double, offsetY As Double)
Parameters
offsetX
- System.Double
The amount to offset this PdfMatrix along the x-axis.
offsetY
- System.Double
The amount to offset this PdfMatrix along the y-axis.
Operators
Equality(PdfMatrix, PdfMatrix)
Determines whether first
and second
PdfMatrixs are equal.
public static bool operator ==(PdfMatrix first, PdfMatrix second)
Public Shared Operator =(first As PdfMatrix, second As PdfMatrix) As Boolean
Parameters
first
- PdfMatrix
The first matrix.
second
- PdfMatrix
The second matrix.
Returns
- System.Boolean
true if first
and second
matrices are equal; otherwise, false.
Inequality(PdfMatrix, PdfMatrix)
Determines whether first
and second
PdfMatrixs are not equal.
public static bool operator !=(PdfMatrix first, PdfMatrix second)
Public Shared Operator <>(first As PdfMatrix, second As PdfMatrix) As Boolean
Parameters
first
- PdfMatrix
The first matrix.
second
- PdfMatrix
The second matrix.
Returns
- System.Boolean
true if first
and second
matrices are not equal; otherwise, false.
Multiply(PdfMatrix, PdfMatrix)
Premultiplies the PdfMatrix representing the additional transformation with the PdfMatrix representing the existing transformation, thus producing the PdfMatrix representing the combined transformation.
public static PdfMatrix operator *(PdfMatrix additionalTransform, PdfMatrix existingTransform)
Public Shared Operator *(additionalTransform As PdfMatrix, existingTransform As PdfMatrix) As PdfMatrix
Parameters
additionalTransform
- PdfMatrix
The additional transformation.
existingTransform
- PdfMatrix
The existing transformation.
Returns
The combined transformation composed of the existingTransform
and the additionalTransform
.