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

Each graphics port (basic or color) has its own local coordinate system. Some Toolbox routines return or expect points that are expressed in the global coordinate system, while others use local coordinates. For example, when the Event Manager function WaitNextEvent reports an event, it gives the cursor location (also called the mouse location) in global coordinates; but when you call the Control Manager function FindControl to find out whether the user clicked a control in one of your windows, you pass the cursor location in local coordinates. You can use the GlobalToLocal procedure to convert global coordinates to local coordinates, and you can use the LocalToGlobal procedure for the reverse.

You can also use the SetPt procedure to create a point, the EqualPt function to compare two points, and the AddPt procedure, SubPt procedure, and DeltaPoint function to shift points. To determine whether the pixel associated with a point is black or white, use the GetPixel function.


Subtopics
GlobalToLocal
LocalToGlobal
AddPt
SubPt
DeltaPoint
SetPt
EqualPt
GetPixel

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996