Matrix2D Class |
Element element = eb.CreateImage(Image(...)); Double deg2rad = 3.1415926535 / 180.0; Matrix2D mtx = Matrix2D(1, 0, 0, 1, 0, 200); // Translate mtx.multiply(Matrix2D(300, 0, 0, 200, 0, 0)); // Scale mtx.multiply(Matrix2D.RotationMatrix(90 * deg2rad)); // Rotate element.GetGState().SetTransform(mtx); writer.WritePlacedElement(element);
... Matrix2D text_mtx = text_element.GetTextMatrix(); Double x, y; for (CharIterator itr = text_element.getCharIterator(); itr.HasNext(); itr.Next()) { x = itr.current().x; // character positioning information y = itr.current().y;
Matrix2D ctm = text_element.getCTM();
Matrix2D mtx = ctm.multiply(text_mtx); mtx.multPoint(x, y);
Namespace: pdftron.Common
public sealed class Matrix2D : IClosable
The Matrix2D type exposes the following members.
Name | Description | |
---|---|---|
Matrix2D |
Creates an identity matrix
| |
Matrix2D(Matrix2D) |
Creates a matrix and initialize it with values from another matrix.
| |
Matrix2D(Double, Double, Double, Double, Double, Double) |
Creates a Matrix object based on six numbers that define an
affine transformation.
|
Name | Description | |
---|---|---|
m_a |
The matrix element in the first row, first column.
| |
m_b |
The matrix element in the first row, second column
| |
m_c |
The matrix element in the second row, first column
| |
m_d |
The matrix element in the second row, second column.
| |
m_h |
The matrix element in the third row, first column.
| |
m_v |
The matrix element in the third row, second column.
|
Name | Description | |
---|---|---|
Close | ||
Concat |
Updates this matrix with the product of itself and another matrix
specified through an argument list.
| |
Equals | (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
IdentityMatrix |
Creates an identity matrix.
{1 0
0 1
0 0}.
| |
Inverse |
If this matrix is invertible, the Inverse method returns its inverse matrix.
| |
Mult(DoubleRef, DoubleRef) |
Transform/multiply the point (in_out_x, in_out_y) using this matrix.
| |
Mult(Matrix2D, Matrix2D) |
Multiply two matrices.
| |
RotationMatrix |
Creates a rotation matrix.
| |
Scale |
The Scale method updates this matrix with the product of itself and a scaling matrix.
(i.e. it is equivalent to this.m_a *= h; this.m_d *= v).
| |
Set(Matrix2D) |
Sets value to given matrix.
| |
Set(Double, Double, Double, Double, Double, Double) |
Sets the elements of this matrix.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Translate |
The Translate method updates this matrix with the product of itself and a
translation matrix (i.e. it is equivalent to this.m_h += h; this.m_v += v).
| |
ZeroMatrix |
Creates a zero matrix (0 0 0 0 0 0).
|