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 2 - Basic QuickDraw / Basic QuickDraw Reference
Routines / Manipulating Points in Graphics Ports


To convert a point's coordinates from the local coordinates of the current graphics port (basic or color) to global coordinates, use the LocalToGlobal procedure.

PROCEDURE LocalToGlobal (VAR pt:\xDDPoint);
The point whose local coordinates are to be converted to global coordinates.
The LocalToGlobal procedure converts the given point from the current graphics port's local coordinate system into the global coordinate system (where the upper-left corner of the main screen has coordinates [0,0]). This global point can then be compared to other global points, or it can be changed into the local coordinates of another graphics port.

Because a rectangle is defined by two points, you can convert a rectangle into global coordinates with two calls to LocalToGlobal. In conjunction with LocalToGlobal, you can use the OffsetRect, OffsetRgn, or OffsetPoly procedures (which are described in the chapter "QuickDraw Drawing") to convert a rectangle, region, or polygon into global coordinates.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996