Applies a linear transformation of the bitmap (based on specified matrix).
Namespace:
Aurigma.GraphicsMill
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public void ApplyMatrix( Matrix matrix )
Type: Aurigma.GraphicsMill.Transforms.Matrix
A Matrix of the linear transformation.Here is an example how to apply skew transform using the affine matrix:
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);