P157
摘要:SetMapMode (hdc, MM_ISOTROPIC) ;SetWindowExtEx (hdc, 160 * GetDeviceCaps (hdc, HORZSIZE) / 254, 160 * GetDeviceCaps (hdc, VERTZISE) / 254, NULL) ;SetViewportExtEx (hdc, GetDeviceCaps (hdc, HORZRES), GetDeviceCaps (hdc, VERTRES)) ;GetDeviceCaps 使用 HORZRES 和 V...
阅读全文
P155 ~ P156 代码错误
摘要:P155 ~ P156对于时钟程序,或许想使用如下这样一个四象限笛卡儿坐标系统:四个方向的轴可以任意缩放,并且逻辑点(0,0)位于客户区的中心。如果希望每个轴的范围是 0 到 1000(举个例子),可以使用下面的代码:SetMapMode (hdc, MM_ISOTROPIC) ;SetWindowExtEx (hdc, 1000, 1000, NULL) ;SetViewportExtEx (hdc, cxClient / 2, -cyClient / 2, NULL) ;SetWindowOrgEx (hdc, cxClient / 2, cy...
阅读全文