| Flash for .NET Task-Based Help > C1FlashCanvas Tasks > Transforming a Drawing Using C1FlashCanvas > Transforming the Drawing |
These instructions assume that you have completed the Scaling the Coordination task.
This topic uses the DrawEllipse method to draw an ellipse and calls the ResetTransform method to reset the transform space. A new transform space is specified by setting the Transform property.
Before you reset the transformation and multiply the drawing, import the Drawing2D and C1Flash namespaces; add the following code to the top of the form:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Imports System.Drawing.Drawing2 Imports C1.C1Flash |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
using System.Drawing.Drawing2D; using C1.C1Flash; |
|
In the Form_Load event handler, you will add code to reset the transformation and multiply the drawing. Complete the following steps:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
' Resets the coordinate Me.C1FlashCanvas1.ResetTransform() Dim i As Integer For i = 1 To 11 Me.C1FlashCanvas1.DrawEllipse(Pens.Red, rect) ' Change the Transform Dim m As Matrix = Me.C1FlashCanvas1.Transform m.Shear(0.15F, 0.15F) Me.C1FlashCanvas1.Transform = m Next i |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
// Resets the coordinate
this.c1FlashCanvas1.ResetTransform();
for(int i = 1; i < 12; i++)
{
this.c1FlashCanvas1.DrawEllipse(Pens.Red, rect);
// Change the Transform
Matrix m = this.c1FlashCanvas1.Transform;
m.Shear(0.15F, 0.15F);
this.c1FlashCanvas1.Transform = m;
}
|
|
Your transformed matrix drawing will look like the following image:
