Important: The information in this document is obsolete and should not be used for new development.
Manipulating Points in Graphics PortsEach 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
WaitNextEventreports an event, it gives the cursor location (also called the mouse location) in global coordinates; but when you call the Control Manager function
FindControlto 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
GlobalToLocalprocedure to convert global coordinates to local coordinates, and you can use the
LocalToGlobalprocedure for the reverse.
You can also use the
SetPtprocedure to create a point, the
EqualPtfunction to compare two points, and the
DeltaPointfunction to shift points. To determine whether the pixel associated with a point is black or white, use the