[MSPAINT] Improve CMiniatureWindow::OnPaint

CORE-18867
This commit is contained in:
Katayama Hirofumi MZ 2023-03-22 08:10:26 +09:00
parent 08248e83a0
commit 68e6820ddf

View file

@ -22,12 +22,14 @@ LRESULT CMiniatureWindow::OnClose(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
LRESULT CMiniatureWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) LRESULT CMiniatureWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{ {
DefWindowProc(WM_PAINT, wParam, lParam); RECT rc;
RECT mclient; GetClientRect(&rc);
HDC hdc;
miniature.GetClientRect(&mclient); PAINTSTRUCT ps;
hdc = miniature.GetDC(); HDC hDC = BeginPaint(&ps);
StretchBlt(hdc, 0, 0, mclient.right, mclient.bottom, imageModel.GetDC(), 0, 0, imageModel.GetWidth(), imageModel.GetHeight(), SRCCOPY); StretchBlt(hDC, 0, 0, rc.right, rc.bottom,
miniature.ReleaseDC(hdc); imageModel.GetDC(), 0, 0, imageModel.GetWidth(), imageModel.GetHeight(),
SRCCOPY);
EndPaint(&ps);
return 0; return 0;
} }