Important: The information in this document is obsolete and should not be used for new development.
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 functionWaitNextEvent
reports an event, it gives the cursor location (also called the mouse location) in global coordinates; but when you call the Control Manager functionFindControl
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 theGlobalToLocal
procedure to convert global coordinates to local coordinates, and you can use theLocalToGlobal
procedure for the reverse.You can also use the
SetPt
procedure to create a point, theEqualPt
function to compare two points, and theAddPt
procedure,SubPt
procedure, andDeltaPoint
function to shift points. To determine whether the pixel associated with a point is black or white, use theGetPixel
function.
Subtopics
- GlobalToLocal
- LocalToGlobal
- AddPt
- SubPt
- DeltaPoint
- SetPt
- EqualPt
- GetPixel