Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 3 - QuickDraw Drawing / QuickDraw Drawing Reference
Routines


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 the MapPt procedure. To map and scale a rectangle within one rectangle to another rectangle, use the MapRect procedure. To map and scale a region within one rectangle to another rectangle, use the MapRgn procedure. To map and scale a polygon within one rectangle to another rectangle, use the MapPoly 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 the LocalGlobal procedure to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal 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

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996