public TransformationMatrix Transformation { get; set; }
Public Property Transformation As TransformationMatrix
Get
Set
public:
property TransformationMatrix Transformation {
TransformationMatrix get ();
void set (TransformationMatrix value);
}
member Transformation : TransformationMatrix with get, set
This property allows applying transformations (e.g. translation, rotation, zoom, etc.) when drawing shapes. It can be particularly useful when drawing shapes directly, without creating a Path instance. For example, the DrawEllipse methods don't offer a parameter for rotation.
Setting this property to a value other than the identity matrix disables path region caching for Path instances, even if Path.PreferCaching is . To achieve the best performance when drawing the same shape with the same transformation multiple times, use a Path instance with caching enabled, apply the transformation to the Path, and use the identity matrix here.
using IReadWriteBitmapData bmp = BitmapDataFactory.CreateBitmapData(100, 100);
bmp.Clear(Color.Cyan);
// Creating a rotation transformation matrix from the center of the ellipse.
var tr = TransformationMatrix.CreateRotationDegrees(45f, new PointF(50f, 50f));
var options = new DrawingOptions { AntiAliasing = true, Transformation = tr };
// Drawing the ellipse with the transformation matrix.
bmp.DrawEllipse(Color.Blue, 0, 25, 100, 50, options);
The example above produces the following result: