SetMapMode()映射模式求解! (画刻度)
case WM_PAINT:hdc = BeginPaint (hwnd, &ps) ;SetMapMode(hdc, MM_LOMETRIC); SetViewportOrgEx (hdc, 0, 0, NULL); MoveToEx(hdc, 100, -100, NULL);LineTo(hdc , 200, -100);EndPaint (hwnd, &ps) ;return 0 ;
引用:先获取设备的信息?这样可以得到像素与真实长度的关系?GetDeviceCaps Retrieves device-specific information for the specified device.我用GetDeviceCaps (hdc, LOGPIXELSX)获取了每英寸像素点数然后获取客户区的像素点数量 除以 每英寸的像素……