mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 03:23:51 +00:00
fix wallpaper style center and implement tile.
svn path=/trunk/; revision=19714
This commit is contained in:
parent
305379b387
commit
ce6ccd9bb5
1 changed files with 99 additions and 16 deletions
|
@ -1228,9 +1228,17 @@ NtUserPaintDesktop(HDC hDC)
|
||||||
sz.cx = DeskWin->WindowRect.right - DeskWin->WindowRect.left;
|
sz.cx = DeskWin->WindowRect.right - DeskWin->WindowRect.left;
|
||||||
sz.cy = DeskWin->WindowRect.bottom - DeskWin->WindowRect.top;
|
sz.cy = DeskWin->WindowRect.bottom - DeskWin->WindowRect.top;
|
||||||
|
|
||||||
|
if(WinSta->WallpaperMode == wmStretch ||
|
||||||
|
WinSta->WallpaperMode == wmTile)
|
||||||
|
{
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
x = (sz.cx / 2) - (WinSta->cxWallpaper / 2);
|
x = (sz.cx / 2) - (WinSta->cxWallpaper / 2);
|
||||||
y = (sz.cy / 2) - (WinSta->cyWallpaper / 2);
|
y = (sz.cy / 2) - (WinSta->cyWallpaper / 2);
|
||||||
|
}
|
||||||
|
|
||||||
hWallpaperDC = NtGdiCreateCompatibleDC(hDC);
|
hWallpaperDC = NtGdiCreateCompatibleDC(hDC);
|
||||||
if(hWallpaperDC != NULL)
|
if(hWallpaperDC != NULL)
|
||||||
|
@ -1239,23 +1247,98 @@ NtUserPaintDesktop(HDC hDC)
|
||||||
|
|
||||||
if(x > 0 || y > 0)
|
if(x > 0 || y > 0)
|
||||||
{
|
{
|
||||||
/* FIXME - clip out the bitmap */
|
/* FIXME - clip out the bitmap
|
||||||
|
can be replaced with "NtGdiPatBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, PATCOPY | DSTINVERT);"
|
||||||
|
once we support DSTINVERT */
|
||||||
PreviousBrush = NtGdiSelectObject(hDC, DesktopBrush);
|
PreviousBrush = NtGdiSelectObject(hDC, DesktopBrush);
|
||||||
NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY);
|
NtGdiPatBlt(hDC, Rect.left, Rect.top, Rect.right, Rect.bottom, PATCOPY);
|
||||||
NtGdiSelectObject(hDC, PreviousBrush);
|
NtGdiSelectObject(hDC, PreviousBrush);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
//Do not fill the background after it is painted no matter the size of the picture
|
||||||
doPatBlt = FALSE;
|
doPatBlt = FALSE;
|
||||||
|
|
||||||
hOldBitmap = NtGdiSelectObject(hWallpaperDC, WinSta->hbmWallpaper);
|
hOldBitmap = NtGdiSelectObject(hWallpaperDC, WinSta->hbmWallpaper);
|
||||||
NtGdiBitBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, hWallpaperDC, 0, 0, SRCCOPY);
|
|
||||||
NtGdiSelectObject(hWallpaperDC, hOldBitmap);
|
|
||||||
|
|
||||||
|
if(WinSta->WallpaperMode == wmStretch)
|
||||||
|
{
|
||||||
|
#if 0 //Broken Stretch Code
|
||||||
|
/* Fix me, stretch the bitmap to fit the screen. I'm not smart enough to do this :( */
|
||||||
|
BITMAPINFO bmINFO;
|
||||||
|
LPVOID pBits;
|
||||||
|
bmINFO.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||||
|
/* Get bits */
|
||||||
|
NtGdiGetDIBits(hDC,
|
||||||
|
WinSta->hbmWallpaper,
|
||||||
|
0,
|
||||||
|
WinSta->cyWallpaper,
|
||||||
|
NULL, // what goes here?
|
||||||
|
&bmINFO,
|
||||||
|
DIB_RGB_COLORS);
|
||||||
|
|
||||||
|
bmINFO.bmiHeader.biCompression = BI_RGB;
|
||||||
|
|
||||||
|
pBits = ExAllocatePool(PagedPool,bmINFO.bmiHeader.biSizeImage);
|
||||||
|
|
||||||
|
if(pBits == NULL)
|
||||||
|
{
|
||||||
|
doPatBlt = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
NtGdiGetDIBits(hDC,
|
||||||
|
WinSta->hbmWallpaper,
|
||||||
|
0,
|
||||||
|
WinSta->cyWallpaper,
|
||||||
|
(LPVOID)pBits, // what goes here?
|
||||||
|
&bmINFO,
|
||||||
|
DIB_RGB_COLORS);
|
||||||
|
DPRINT1("Before Draw\n");
|
||||||
|
|
||||||
|
/* Stretch it to fit the screen */
|
||||||
|
NtGdiStretchDIBits(hDC,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
Rect.right,
|
||||||
|
Rect.bottom,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
WinSta->cxWallpaper,
|
||||||
|
WinSta->cyWallpaper,
|
||||||
|
(LPVOID)pBits, // get this from NtGdiGetDiBits?
|
||||||
|
&bmINFO, // get this from NtGdiGetDiBits?
|
||||||
|
DIB_RGB_COLORS,
|
||||||
|
SRCCOPY);
|
||||||
|
ExFreePool(pBits);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* Draw nothing */
|
||||||
|
doPatBlt = TRUE;
|
||||||
|
#endif //Broken Stretch Code
|
||||||
|
}
|
||||||
|
else if(WinSta->WallpaperMode == wmTile)
|
||||||
|
{
|
||||||
|
|
||||||
|
for(y = 0; y < Rect.bottom; y += WinSta->cyWallpaper)
|
||||||
|
{
|
||||||
|
for(x = 0; x < Rect.right; x += WinSta->cxWallpaper)
|
||||||
|
{
|
||||||
|
NtGdiBitBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, hWallpaperDC, 0, 0, SRCCOPY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NtGdiBitBlt(hDC, x, y, WinSta->cxWallpaper, WinSta->cyWallpaper, hWallpaperDC, 0, 0, SRCCOPY);
|
||||||
|
}
|
||||||
|
NtGdiSelectObject(hWallpaperDC, hOldBitmap);
|
||||||
NtGdiDeleteDC(hWallpaperDC);
|
NtGdiDeleteDC(hWallpaperDC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Back ground is set to none, clear the screen */
|
||||||
if (doPatBlt)
|
if (doPatBlt)
|
||||||
{
|
{
|
||||||
PreviousBrush = NtGdiSelectObject(hDC, DesktopBrush);
|
PreviousBrush = NtGdiSelectObject(hDC, DesktopBrush);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue