GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfMatrix Struct

    Namespace:
    GemBox.Pdf.Content
    Assembly:
    GemBox.Pdf.dll

    Represents a 3x3 affine transformation matrix used for transformations in PDF 2-D space.

    • C#
    • VB.NET
    public struct PdfMatrix : IEquatable<PdfMatrix>
    Public Structure PdfMatrix
        Implements IEquatable(Of PdfMatrix)
    Implements
    System.IEquatable<PdfMatrix>

    Constructors

    PdfMatrix(Double, Double, Double, Double, Double, Double)

    Initializes a new instance of the PdfMatrix structure.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public static readonly PdfMatrix Identity { get; }
    Public Shared ReadOnly Property Identity As PdfMatrix
    Property Value
    PdfMatrix

    An identity matrix.

    IsIdentity

    Gets a value that indicates whether this PdfMatrix structure is an identity matrix.

    • C#
    • VB.NET
    public readonly bool IsIdentity { get; }
    Public ReadOnly Property IsIdentity As Boolean
    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.

    • C#
    • VB.NET
    public readonly double M11 { get; }
    Public ReadOnly Property M11 As Double
    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.

    • C#
    • VB.NET
    public readonly double M12 { get; }
    Public ReadOnly Property M12 As Double
    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.

    • C#
    • VB.NET
    public readonly double M21 { get; }
    Public ReadOnly Property M21 As Double
    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.

    • C#
    • VB.NET
    public readonly double M22 { get; }
    Public ReadOnly Property M22 As Double
    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.

    • C#
    • VB.NET
    public readonly double OffsetX { get; }
    Public ReadOnly Property OffsetX As Double
    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.

    • C#
    • VB.NET
    public readonly double OffsetY { get; }
    Public ReadOnly Property OffsetY As Double
    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.

    • C#
    • VB.NET
    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
    PdfMatrix

    A translation PdfMatrix with the specified offsets.

    Equals(PdfMatrix)

    Determines whether the other PdfMatrix is equal to this PdfMatrix instance.

    • C#
    • VB.NET
    public bool Equals(PdfMatrix other)
    Public Function Equals(other As PdfMatrix) As Boolean
    Parameters
    other
    PdfMatrix

    The other matrix to compare with this matrix instance.

    Returns
    System.Boolean

    true if the other PdfMatrix is equal to this PdfMatrix instance; otherwise, false.

    Equals(Object)

    Determines whether the specified System.Object is equal to this PdfMatrix instance.

    • C#
    • VB.NET
    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

    true if the specified System.Object is a PdfMatrix and is equal to this PdfMatrix instance; otherwise, false.

    Overrides
    System.ValueType.Equals(System.Object)

    GetHashCode()

    Returns a hash code for this PdfMatrix instance.

    • C#
    • VB.NET
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    Returns
    System.Int32

    An integer value that specifies a hash value for this PdfMatrix instance.

    Overrides
    System.ValueType.GetHashCode()

    Invert()

    Inverts this PdfMatrix structure.

    • C#
    • VB.NET
    public bool Invert()
    Public Function Invert As Boolean
    Returns
    System.Boolean

    true if this PdfMatrix structure was inverted; otherwise, false if this PdfMatrix structure is not invertible.

    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.

    • C#
    • VB.NET
    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
    PdfMatrix

    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this PdfMatrix instance.

    Overrides
    System.ValueType.ToString()
    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)

    Transforms the specified PdfPoint by this PdfMatrix.

    • C#
    • VB.NET
    public PdfPoint Transform(PdfPoint point)
    Public Function Transform(point As PdfPoint) As PdfPoint
    Parameters
    point
    PdfPoint

    The point to transform.

    Returns
    PdfPoint

    The transformed point.

    Transform(ref PdfQuad)

    Transforms the specified PdfQuad by this PdfMatrix.

    • C#
    • VB.NET
    public void Transform(ref PdfQuad quad)
    Public Sub Transform(ByRef quad As 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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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
    PdfMatrix

    The combined transformation composed of the existingTransform and the additionalTransform.

    Implements

    System.IEquatable<T>
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.