ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
```c++ inline int DPI_SCALE( int x) { static int g_DeviceCaps = 0; if (g_DeviceCaps == 0) { HDC hdc = ::GetDC(NULL);//获取dc //检索有关显示设备的各种设备特定信息。如果函数成功,则请求的功能的值。 g_DeviceCaps = GetDeviceCaps(hdc, LOGPIXELSY); ReleaseDC(NULL,hdc); } int nRet = MulDiv(x, g_DeviceCaps,96 ); return nRet; } ```