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
ScalePtprocedure. To map a point in one rectangle to an equivalent position in another rectangle, use theMapPtprocedure. To map and scale a rectangle within one rectangle to another rectangle, use theMapRectprocedure. To map and scale a region within one rectangle to another rectangle, use theMapRgnprocedure. To map and scale a polygon within one rectangle to another rectangle, use theMapPolyprocedure.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
SetPortprocedure to change to the graphics port containing the points or rectangles, using theLocalGlobalprocedure to convert their locations to global coordinates, usingSetPortto return to your starting graphics port, and then using theGlobalToLocalprocedure 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