kwib799
March 7th, 2005, 03:54 AM
SetMapMode (hdc, MM_ISOTROPIC) ;
SetWindowExtEx (hdc, 276, 72, NULL) ;
SetViewportExtEx (hdc, cxClient, cyClient, NULL) ;
SetWindowOrgEx (hdc, 138, 36, NULL) ;
SetViewportOrgEx (hdc, cxClient / 2, cyClient / 2, NULL) ;
===========
The code above is excerpted form Programming Windows "Digital Clock" example.
I have no problem with the most code but other than the code above.I trying to understand it line by line by any means, but achieve a little progress. Can anybody give me a fully explanation why after the code excution the logical point (0,0) shifted to the (0, something).
I know after the code "SetWindowOrgEx (hdc, 138, 36, NULL) ;" the logical point (0,0) lie beyond the window's client area left upper corner , but after the code "SetViewportOrgEx (hdc, cxClient / 2, cyClient / 2, NULL) ;" I don't know what's happening. But from what I understanding the logical point (0,0) should be lies in the middle of the client area, but obviously that's not what the final result turn out to be. I eagerly need step by step explanation. Thanks for viewing and answering!
SetWindowExtEx (hdc, 276, 72, NULL) ;
SetViewportExtEx (hdc, cxClient, cyClient, NULL) ;
SetWindowOrgEx (hdc, 138, 36, NULL) ;
SetViewportOrgEx (hdc, cxClient / 2, cyClient / 2, NULL) ;
===========
The code above is excerpted form Programming Windows "Digital Clock" example.
I have no problem with the most code but other than the code above.I trying to understand it line by line by any means, but achieve a little progress. Can anybody give me a fully explanation why after the code excution the logical point (0,0) shifted to the (0, something).
I know after the code "SetWindowOrgEx (hdc, 138, 36, NULL) ;" the logical point (0,0) lie beyond the window's client area left upper corner , but after the code "SetViewportOrgEx (hdc, cxClient / 2, cyClient / 2, NULL) ;" I don't know what's happening. But from what I understanding the logical point (0,0) should be lies in the middle of the client area, but obviously that's not what the final result turn out to be. I eagerly need step by step explanation. Thanks for viewing and answering!