TransformsProvider.ApplyMatrix Method (Matrix)

Applies a linear transformation of the bitmap (based on specified matrix).

Namespace: Aurigma.GraphicsMill
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

C#
public void ApplyMatrix(
	Matrix matrix
)

Parameters

matrix

Type: Aurigma.GraphicsMill.Transforms.Matrix

A Matrix of the linear transformation.

Remarks

You can also use MatrixTransform class to apply this effect.

Examples

Here is an example how to apply skew transform using the affine matrix:

C#
int horizontalOffset = 20;
int verticalOffset = 40;

System.Drawing.PointF[] sourcePoints = new System.Drawing.PointF[]{
    new System.Drawing.PointF(0.0F, 0.0F), 
    new System.Drawing.PointF(bitmap.Width - 1, 0.0F),
    new System.Drawing.PointF(0.0F, bitmap.Height - 1)
};

System.Drawing.PointF[] destinationPoints = new System.Drawing.PointF[]{
    new System.Drawing.PointF(0, 0),
    new System.Drawing.PointF(bitmap.Width - 1, verticalOffset),
    new System.Drawing.PointF(horizontalOffset, bitmap.Height - 1)
};

var matrix = Matrix.CreateFromAffinePoints(sourcePoints, destinationPoints);
bitmap.Transforms.ApplyMatrix(matrix);

See Also

Reference

Manual