IntCreateCompatibleBitmap(
PDC Dc,
INT Width,
- INT Height)
+ INT Height,
+ UINT Planes,
+ UINT Bpp)
{
HBITMAP Bmp = NULL;
PPALETTE ppal;
Bmp = GreCreateBitmap(abs(Width),
abs(Height),
- 1,
- Dc->ppdev->gdiinfo.cBitsPixel,
+ Planes ? Planes : 1,
+ Bpp ? Bpp : Dc->ppdev->gdiinfo.cBitsPixel,
NULL);
psurf = SURFACE_ShareLockSurface(Bmp);
ASSERT(psurf);
/* Set flags */
psurf->flags = API_BITMAP;
psurf->hdc = NULL; // FIXME:
+ psurf->SurfObj.hdev = (HDEV)Dc->ppdev;
SURFACE_ShareUnlockSurface(psurf);
}
else
Bmp = GreCreateBitmap(abs(Width),
abs(Height),
- 1,
- dibs.dsBm.bmBitsPixel,
+ Planes ? Planes : 1,
+ Bpp ? Bpp : dibs.dsBm.bmBitsPixel,
NULL);
psurfBmp = SURFACE_ShareLockSurface(Bmp);
ASSERT(psurfBmp);
/* Set flags */
psurfBmp->flags = API_BITMAP;
psurfBmp->hdc = NULL; // FIXME:
+ psurf->SurfObj.hdev = (HDEV)Dc->ppdev;
SURFACE_ShareUnlockSurface(psurfBmp);
}
else if (Count == sizeof(DIBSECTION))
bi->bmiHeader.biSize = sizeof(bi->bmiHeader);
bi->bmiHeader.biWidth = Width;
bi->bmiHeader.biHeight = Height;
- bi->bmiHeader.biPlanes = dibs.dsBmih.biPlanes;
- bi->bmiHeader.biBitCount = dibs.dsBmih.biBitCount;
+ bi->bmiHeader.biPlanes = Planes ? Planes : dibs.dsBmih.biPlanes;
+ bi->bmiHeader.biBitCount = Bpp ? Bpp : dibs.dsBmih.biBitCount;
bi->bmiHeader.biCompression = dibs.dsBmih.biCompression;
bi->bmiHeader.biSizeImage = 0;
bi->bmiHeader.biXPelsPerMeter = dibs.dsBmih.biXPelsPerMeter;
return NULL;
}
- Bmp = IntCreateCompatibleBitmap(Dc, Width, Height);
+ Bmp = IntCreateCompatibleBitmap(Dc, Width, Height, 0, 0);
DC_UnlockDc(Dc);
return Bmp;