PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

converting coords. device to logial and vice-versa

hello, anyone know how to convert device coordinates to logical and vice-versa ?
BTW, wheres gapidraw 2.0 ?

thanks in advance

-vic
I'm not sure what you mean by converting from device coords to logical. Do you mean screen space to world space coordinates?
i think i got it..
i was talking about screen to window and vice-versa
ClientToScreen()
vic: GapiDraw already contains features for all that.. The GapiDraw function also scales the coordinates with respect to your windows scale (so if you resize the window, the coordinates will scale as well).. And the GapiDraw function also adjusts the coordinates if the display should be rotated:

This is how it's done in CGapiApplication 1.04:

Code:
case WM_LBUTTONDOWN:
{
POINT p;
p.x = LOWORD(lParam);
p.y = HIWORD(lParam);
m_display.DeviceToLogical(&p);
StylusDown(p);
}
return 0;


GapiDraw 2.0 has some further refinements to deal with negative coordinates. Finally. If you use CGapiApplication as a base class you don't need to think about this. All coordinates you receive on StylusDown() are already adjusted...

GapiDraw 2.0 will be released when there are no more issues with it. It can be today, tomorrow or Monday.. I would guess tomorrow or Monday...
vic: If you have further questions on more generic windows programming, please do use the "Developer" forum at PocketMatrix.com or I will have to move your future posts to that forum. This forum is strictly related to the use of GapiDraw, not how to build generic windows-wrapper classes.

//Johan
(Having a feeling that a couple of dozen more windows-programming-related questions are about to pop up) :)
hmm yup you're right ! im sorry for that.. i got things working here.. been looking into the headers of gapidraw! thanks for all the help

catch ya l8r
peace !