LocalToGlobal
Point *thePoint ; address of point to convert; receives result LocalToGlobal converts the coordinates of a local point (relative to the current GrafPort origin) to global ( screen) coordinates. It can then be compared to other global points or converted to the local coordinates of a
thePoint is the address of a 4-byte Point structure, expressed in coordinates of the current GrafPort. Upon return, it will contain the coordinates of that same position, expressed to the global, screen coordinates.
Notes: The result of the conversion is based relative to coordinate (0,0) of the
device's BitMap; typically the screen. To convert the coordinates of a rectangle from local to global, you can apply
this call to both corners; e.g.:
Rectangles and other graphic elements ( regions and polygons) can be
converted to the global coordinate system via a 3-step sequence:
local item.
and global coordinate systems.
For instance, the following sequence converts a local Polygon to global coordinates:
PolyHandle thePoly;
tmpPt= localPt=topLeft( (*thePoly)->polyBBox ); /* get corner */
SubPt( localPt, &tmpPt ); /* find difference */ OffsetPoly( thePoly, tmpPt.h, tmpPt.v ); /* move the item */