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 functionWaitNextEventreports an event, it gives the cursor location (also called the mouse location) in global coordinates; but when you call the Control Manager functionFindControlto find out whether the user clicked a control in one of your windows, you pass the cursor location in local coordinates. You can use theGlobalToLocalprocedure to convert global coordinates to local coordinates, and you can use theLocalToGlobalprocedure for the reverse.You can also use the
SetPtprocedure to create a point, theEqualPtfunction to compare two points, and theAddPtprocedure,SubPtprocedure, andDeltaPointfunction to shift points. To determine whether the pixel associated with a point is black or white, use theGetPixelfunction.
Subtopics
- GlobalToLocal
- LocalToGlobal
- AddPt
- SubPt
- DeltaPoint
- SetPt
- EqualPt
- GetPixel