🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
```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; } ```