






Transforming a 2D graphic
Transformation is the process of altering every point in a graphic to resize (scale), reorient (rotate), or move (translate) the graphic. MGraphic has the transformation functions shown in Figure 23. TranslateBy, RotateBy, and ScaleBy let you transform a 2-D graphic without using a matrix. You supply the values, and their default implementations create a temporary matrix and call the TransformBy function, which takes an instance of TGrafMatrix as a parameter. Transformations change the points of the 2-D geometry directly (except in the case of TEllipse) without copying the original points.
Figure 23 shows the relationships of the MGraphic and TGrafMatrix classes. TGrafMatrix is a 3-by-3 matrix for performing algebraic operations on a set of coordinate points (regular points, rational points, or vectors) that define a 2D graphic. TGrafMatrix is described at length in Chapter 2.

[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.
Generated with WebMaker