Article ID: 49753 - Last Review: January 8, 2003 - Revision: 1.1 LocalToGlobal/GlobalToLocal Convert Window/Screen CoordinatesThis article was previously published under Q49753 On This PageSUMMARY
This article gives examples of how to use LocalToGlobal and
GlobalToLocal, which are Microsoft BASIC Library Code (MBLC) routines
built into Microsoft QuickBASIC Version 1.00 for the Apple Macintosh.
LocalToGlobal and GlobalToLocal are useful to coordinate graphics statements that use screen coordinates with those that use window coordinates. LocalToGlobal takes a point, measured in y and x coordinates in pixels relative to the current output window, and returns its current coordinates relative to the Macintosh screen. GlobalToLocal takes a point, measured in y and x coordinates in pixels relative to the Macintosh screen, and returns its current coordinates relative to the current output window. MORE INFORMATION
On the Macintosh, a point at coordinates (0,0) is at the upper-left
corner (of the screen or window). Pixels in the y direction are
positive when below the upper-left corner. Pixels in the x direction
are positive when to the right of the upper-left corner.
LocalToGlobal ExampleThe following program shows how the global screen coordinates of a fixed local window point change as the window is dragged:GlobalToLocal ExampleThe following program shows how the local window coordinates of a fixed global screen point change as the window is dragged: | Article Translations
|

Back to the top
