mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 06:51:20 +00:00
[User32]
- Patch by Huw Davies : Merge the blitting of the centered and non-centered cases. svn path=/trunk/; revision=66184
This commit is contained in:
parent
e0152471f9
commit
cc48a3494b
1 changed files with 7 additions and 12 deletions
|
@ -823,19 +823,14 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
|
||||||
GetClientRect(hwnd, &rcClient);
|
GetClientRect(hwnd, &rcClient);
|
||||||
if (style & SS_CENTERIMAGE)
|
if (style & SS_CENTERIMAGE)
|
||||||
{
|
{
|
||||||
INT x, y;
|
rcClient.left = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
|
||||||
x = (rcClient.right - rcClient.left)/2 - bm.bmWidth/2;
|
rcClient.top = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
|
||||||
y = (rcClient.bottom - rcClient.top)/2 - bm.bmHeight/2;
|
rcClient.right = rcClient.left + bm.bmWidth;
|
||||||
FillRect( hdc, &rcClient, hbrush );
|
rcClient.bottom = rcClient.top + bm.bmHeight;
|
||||||
BitBlt(hdc, x, y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0,
|
|
||||||
SRCCOPY);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
StretchBlt(hdc, 0, 0, rcClient.right - rcClient.left,
|
|
||||||
rcClient.bottom - rcClient.top, hMemDC,
|
|
||||||
0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
|
|
||||||
}
|
}
|
||||||
|
StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
|
||||||
|
rcClient.bottom - rcClient.top, hMemDC,
|
||||||
|
0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
|
||||||
SelectObject(hMemDC, oldbitmap);
|
SelectObject(hMemDC, oldbitmap);
|
||||||
DeleteDC(hMemDC);
|
DeleteDC(hMemDC);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue