Class TransformationMatrix
3-by-3 matrix for affine geometric transformation.
Inherited Members
Namespace: Codecrete.SwissQRBill.Generator.Canvas
Assembly: Codecrete.SwissQRBill.Core.dll
Syntax
public class TransformationMatrix
Constructors
| Edit this page View SourceTransformationMatrix()
Creates a new identity matrix instance.
Declaration
public TransformationMatrix()
Properties
| Edit this page View SourceElements
Matrix elements in row-major order.
As the elements of the third column are always [ 0, 0, 1 ], only the first two columns are returned, i.e. 6 elements.
Declaration
public double[] Elements { get; }
Property Value
Type | Description |
---|---|
double[] |
TranslationX
Gets the horizontal translation.
Declaration
public double TranslationX { get; }
Property Value
Type | Description |
---|---|
double |
TranslationY
Gets the vertical translation.
Declaration
public double TranslationY { get; }
Property Value
Type | Description |
---|---|
double |
Methods
| Edit this page View SourceRotate(double)
Applies a rotation about the origin (prepend).
Declaration
public void Rotate(double angle)
Parameters
Type | Name | Description |
---|---|---|
double | angle | Rotation angle (in radians) |
Scale(double, double)
Applies a scaling relative to the origin (prepend).
Declaration
public void Scale(double sx, double sy)
Parameters
Type | Name | Description |
---|---|---|
double | sx | horizontal scaling |
double | sy | vertical scaling |
Translate(double, double)
Applies a translation to the matrix (prepend).
Declaration
public void Translate(double dx, double dy)
Parameters
Type | Name | Description |
---|---|---|
double | dx | horizontal translation |
double | dy | vertical translation |