May 2004
Intermediate to advanced
888 pages
22h 31m
English
Listing 7.19 gives a brief example of dealing with the Graphics.TranslateTransform() method. Internally, the TranslateTransform() method uses a Matrix class to represent the world transformation matrix used in calculating position, angle, and so on of where drawing occurs. A simple example of shifting where point [0, 0] on world coordinates appears on page coordinates is shown in Listing 7.21.
1: procedure TWinForm.DrawBasicTransform(g: Graphics); 2: var 3: MyPen: Pen; 4: begin 5: MyPen := Pen.Create(Color.Black, 3); 6: g.DrawLine(MyPen, 50, 50, 300, 50); 7: g.DrawLine(MyPen, 50, 50, 50, 300); 8: 9: g.TranslateTransform(100, 100); 10: g.DrawLine(MyPen, ... |
Read now
Unlock full access