Commit b3d1ea85 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

gdi32: Test the "alpha" channel on compatible bitmaps.

parent 7f97af2e
...@@ -119,8 +119,10 @@ static void test_createdibitmap(void) ...@@ -119,8 +119,10 @@ static void test_createdibitmap(void)
{ {
HDC hdc, hdcmem; HDC hdc, hdcmem;
BITMAPINFOHEADER bmih; BITMAPINFOHEADER bmih;
BITMAPINFO bm;
HBITMAP hbm, hbm_colour, hbm_old; HBITMAP hbm, hbm_colour, hbm_old;
INT screen_depth; INT screen_depth;
DWORD pixel;
hdc = GetDC(0); hdc = GetDC(0);
screen_depth = GetDeviceCaps(hdc, BITSPIXEL); screen_depth = GetDeviceCaps(hdc, BITSPIXEL);
...@@ -219,7 +221,30 @@ static void test_createdibitmap(void) ...@@ -219,7 +221,30 @@ static void test_createdibitmap(void)
test_bitmap_info(hbm, 1, &bmih); test_bitmap_info(hbm, 1, &bmih);
DeleteObject(hbm); DeleteObject(hbm);
} }
/* Test how formats are converted */
pixel = 0xffffffff;
bmih.biBitCount = 1;
bmih.biWidth = 1;
bmih.biHeight = 1;
memset(&bm, 0, sizeof(bm));
bm.bmiHeader.biSize = sizeof(bm.bmiHeader);
bm.bmiHeader.biWidth = 1;
bm.bmiHeader.biHeight = 1;
bm.bmiHeader.biPlanes = 1;
bm.bmiHeader.biBitCount= 24;
bm.bmiHeader.biCompression= BI_RGB;
bm.bmiHeader.biSizeImage = 0;
hbm = CreateDIBitmap(hdc, &bmih, CBM_INIT, &pixel, &bm, DIB_RGB_COLORS);
ok(hbm != NULL, "CreateDIBitmap failed\n");
pixel = 0xdeadbeef;
bm.bmiHeader.biBitCount= 32;
GetDIBits(hdc, hbm, 0, 1, &pixel, &bm, DIB_RGB_COLORS);
ok(pixel == 0x00ffffff, "Reading a 32 bit pixel from a DDB returned %08x\n", pixel);
DeleteObject(hbm);
ReleaseDC(0, hdc); ReleaseDC(0, hdc);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment