Important: The information in this document is obsolete and should not be used for new development.
Scaling and Mapping Points, Rectangles, Polygons, and Regions
QuickDraw provides procedures to help you map points, rectangles, regions, and polygons from one rectangle to another. You can scale rectangles, regions, and polygons into other rectangles.To derive vertical and horizontal scaling factors from the proportions of two rectangles, use the
ScalePt
procedure. To map a point in one rectangle to an equivalent position in another rectangle, use theMapPt
procedure. To map and scale a rectangle within one rectangle to another rectangle, use theMapRect
procedure. To map and scale a region within one rectangle to another rectangle, use theMapRgn
procedure. To map and scale a polygon within one rectangle to another rectangle, use theMapPoly
procedure.If the points or rectangles supplied to these routines are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the
SetPort
procedure to change to the graphics port containing the points or rectangles, using theLocalGlobal
procedure to convert their locations to global coordinates, usingSetPort
to return to your starting graphics port, and then using theGlobalToLocal
procedure to convert the locations of points or rectangles to the local coordinates of your current graphics port. These procedures are described in the chapter "Basic QuickDraw."
Subtopics
- ScalePt
- MapPt
- MapRect
- MapRgn
- MapPoly