[MSPAINT] Do type-cast (float) for xDpi and yDpi

CORE-19094
This commit is contained in:
Katayama Hirofumi MZ 2023-10-12 19:43:29 +09:00
parent 409df2355e
commit 70d5c864bc

View file

@ -231,8 +231,8 @@ HBITMAP InitializeImage(LPCWSTR name, LPWIN32_FIND_DATAW pFound, BOOL isFile)
return NULL;
HDC hScreenDC = ::GetDC(NULL);
g_xDpi = ::GetDeviceCaps(hScreenDC, LOGPIXELSX);
g_yDpi = ::GetDeviceCaps(hScreenDC, LOGPIXELSY);
g_xDpi = (float)::GetDeviceCaps(hScreenDC, LOGPIXELSX);
g_yDpi = (float)::GetDeviceCaps(hScreenDC, LOGPIXELSY);
::ReleaseDC(NULL, hScreenDC);
return SetBitmapAndInfo(hBitmap, name, pFound, isFile);
@ -293,8 +293,8 @@ HBITMAP DoLoadImageFile(HWND hwnd, LPCWSTR name, BOOL fIsMainFile)
if (xDpi <= 0 || yDpi <= 0)
{
HDC hDC = ::GetDC(NULL);
xDpi = ::GetDeviceCaps(hDC, LOGPIXELSX);
yDpi = ::GetDeviceCaps(hDC, LOGPIXELSY);
xDpi = (float)::GetDeviceCaps(hDC, LOGPIXELSX);
yDpi = (float)::GetDeviceCaps(hDC, LOGPIXELSY);
::ReleaseDC(NULL, hDC);
}