Returns the current transformation System.Drawing.Drawing2D.Matrix of this AnnObject.
public Matrix Transform { get; } Public ReadOnly Property Transform As Matrix
public:property Matrix^ Transform {Matrix^ get();}
The current transformation System.Drawing.Drawing2D.Matrix of this AnnObject.
Each annotation object has a transformation matrix associated with it. You can perform various operations on this matrix by calling ResetTransform, Translate, Scale and Rotate.
Derived annotation objects can control the transformation operation by overriding the TransformObjectMode property.
This example will perform various transformation on an annotation object then shows its transformation matrix.
using Leadtools;using Leadtools.Annotations;using Leadtools.Codecs;using Leadtools.WinForms;using Leadtools.Drawing;private void AnnObject_Transform(AnnObject obj){// show the matrixShowMatrix(obj.Transform);obj.Translate(2, 3);ShowMatrix(obj.Transform);obj.Scale(1.5F, 1.5F, obj.Origin);ShowMatrix(obj.Transform);obj.Rotate(45, obj.Origin);ShowMatrix(obj.Transform);obj.ResetTransform();ShowMatrix(obj.Transform);}private void ShowMatrix(Matrix mat){int index = 0;for (int i = 0; i < 3; i++){for (int j = 0; j < 2; j++)Console.Write("{0}, ", mat.Elements[index++]);Console.WriteLine("{0}", i == 2 ? "1" : "0");Console.WriteLine("---------");}}
Imports LeadtoolsImports Leadtools.AnnotationsImports Leadtools.CodecsImports Leadtools.WinFormsImports Leadtools.DrawingPrivate Sub AnnObject_Transform(ByVal obj As AnnObject)' show the matrixShowMatrix(obj.Transform)obj.Translate(2, 3)ShowMatrix(obj.Transform)obj.Scale(1.5F, 1.5F, obj.Origin)ShowMatrix(obj.Transform)obj.Rotate(45, obj.Origin)ShowMatrix(obj.Transform)obj.ResetTransform()ShowMatrix(obj.Transform)End SubPrivate Sub ShowMatrix(ByVal mat As Matrix)Dim index As Integer = 0For i As Integer = 0 To 2For j As Integer = 0 To 1Console.Write("{0}, ", mat.Elements(index))index += 1Next jIf i = 2 ThenConsole.WriteLine("{0}", "1")ElseConsole.WriteLine("{0}", "0")End IfConsole.WriteLine("---------")Next iEnd Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
