2 * Unit test suite for bitmaps
4 * Copyright 2004 Huw Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #include "wine/test.h"
34 static void test_createdibitmap(void)
37 BITMAPINFOHEADER bmih
;
39 HBITMAP hbm
, hbm_colour
, hbm_old
;
43 screen_depth
= GetDeviceCaps(hdc
, BITSPIXEL
);
44 memset(&bmih
, 0, sizeof(bmih
));
45 bmih
.biSize
= sizeof(bmih
);
50 bmih
.biCompression
= BI_RGB
;
52 /* First create an un-initialised bitmap. The depth of the bitmap
53 should match that of the hdc and not that supplied in bmih.
56 /* First try 32 bits */
57 hbm
= CreateDIBitmap(hdc
, &bmih
, 0, NULL
, NULL
, 0);
58 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
59 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
61 ok(bm
.bmBitsPixel
== screen_depth
, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, screen_depth
);
66 hbm
= CreateDIBitmap(hdc
, &bmih
, 0, NULL
, NULL
, 0);
67 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
68 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
70 ok(bm
.bmBitsPixel
== screen_depth
, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, screen_depth
);
75 hbm
= CreateDIBitmap(hdc
, &bmih
, 0, NULL
, NULL
, 0);
76 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
77 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
79 ok(bm
.bmBitsPixel
== screen_depth
, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, screen_depth
);
82 /* Now with a monochrome dc we expect a monochrome bitmap */
83 hdcmem
= CreateCompatibleDC(hdc
);
85 /* First try 32 bits */
87 hbm
= CreateDIBitmap(hdcmem
, &bmih
, 0, NULL
, NULL
, 0);
88 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
89 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
91 ok(bm
.bmBitsPixel
== 1, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, 1);
96 hbm
= CreateDIBitmap(hdcmem
, &bmih
, 0, NULL
, NULL
, 0);
97 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
98 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
100 ok(bm
.bmBitsPixel
== 1, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, 1);
105 hbm
= CreateDIBitmap(hdcmem
, &bmih
, 0, NULL
, NULL
, 0);
106 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
107 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
109 ok(bm
.bmBitsPixel
== 1, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, 1);
112 /* Now select a polychrome bitmap into the dc and we expect
113 screen_depth bitmaps again */
114 hbm_colour
= CreateCompatibleBitmap(hdc
, 1, 1);
115 hbm_old
= SelectObject(hdcmem
, hbm_colour
);
117 /* First try 32 bits */
118 bmih
.biBitCount
= 32;
119 hbm
= CreateDIBitmap(hdcmem
, &bmih
, 0, NULL
, NULL
, 0);
120 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
121 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
123 ok(bm
.bmBitsPixel
== screen_depth
, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, screen_depth
);
127 bmih
.biBitCount
= 16;
128 hbm
= CreateDIBitmap(hdcmem
, &bmih
, 0, NULL
, NULL
, 0);
129 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
130 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
132 ok(bm
.bmBitsPixel
== screen_depth
, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, screen_depth
);
137 hbm
= CreateDIBitmap(hdcmem
, &bmih
, 0, NULL
, NULL
, 0);
138 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
139 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
141 ok(bm
.bmBitsPixel
== screen_depth
, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, screen_depth
);
144 SelectObject(hdcmem
, hbm_old
);
145 DeleteObject(hbm_colour
);
148 /* If hdc == 0 then we get a 1 bpp bitmap */
150 bmih
.biBitCount
= 32;
151 hbm
= CreateDIBitmap(0, &bmih
, 0, NULL
, NULL
, 0);
152 ok(hbm
!= NULL
, "CreateDIBitmap failed\n");
153 ok(GetObject(hbm
, sizeof(bm
), &bm
), "GetObject failed\n");
155 ok(bm
.bmBitsPixel
== 1, "CreateDIBitmap created bitmap of incorrect depth %d != %d\n", bm
.bmBitsPixel
, 1);
162 #define test_color_todo(got, exp, txt, todo) \
163 if (!todo && got != exp && screen_depth < 24) { \
164 todo_wine ok(0, #txt " failed at %d-bit screen depth: got 0x%06x expected 0x%06x - skipping DIB tests\n", \
165 screen_depth, (UINT)got, (UINT)exp); \
167 } else if (todo) todo_wine { ok(got == exp, #txt " failed: got 0x%06x expected 0x%06x\n", (UINT)got, (UINT)exp); } \
168 else ok(got == exp, #txt " failed: got 0x%06x expected 0x%06x\n", (UINT)got, (UINT)exp) \
170 #define test_color(hdc, color, exp, todo_setp, todo_getp) \
173 c = SetPixel(hdc, 0, 0, color); \
174 if (!is_win9x) { test_color_todo(c, exp, SetPixel, todo_setp); } \
175 c = GetPixel(hdc, 0, 0); \
176 test_color_todo(c, exp, GetPixel, todo_getp); \
179 static void test_dibsections(void)
181 HDC hdc
, hdcmem
, hdcmem2
;
182 HBITMAP hdib
, oldbm
, hdib2
, oldbm2
;
183 char bmibuf
[sizeof(BITMAPINFO
) + 256 * sizeof(RGBQUAD
)];
184 char bcibuf
[sizeof(BITMAPCOREINFO
) + 256 * sizeof(RGBTRIPLE
)];
185 BITMAPINFO
*pbmi
= (BITMAPINFO
*)bmibuf
;
186 BITMAPCOREINFO
*pbci
= (BITMAPCOREINFO
*)bcibuf
;
192 char logpalbuf
[sizeof(LOGPALETTE
) + 256 * sizeof(PALETTEENTRY
)];
193 LOGPALETTE
*plogpal
= (LOGPALETTE
*)logpalbuf
;
196 HPALETTE hpal
, oldpal
;
202 screen_depth
= GetDeviceCaps(hdc
, BITSPIXEL
) * GetDeviceCaps(hdc
, PLANES
);
203 memset(pbmi
, 0, sizeof(bmibuf
));
204 pbmi
->bmiHeader
.biSize
= sizeof(pbmi
->bmiHeader
);
205 pbmi
->bmiHeader
.biHeight
= 16;
206 pbmi
->bmiHeader
.biWidth
= 16;
207 pbmi
->bmiHeader
.biBitCount
= 1;
208 pbmi
->bmiHeader
.biPlanes
= 1;
209 pbmi
->bmiHeader
.biCompression
= BI_RGB
;
210 pbmi
->bmiColors
[0].rgbRed
= 0xff;
211 pbmi
->bmiColors
[0].rgbGreen
= 0;
212 pbmi
->bmiColors
[0].rgbBlue
= 0;
213 pbmi
->bmiColors
[1].rgbRed
= 0;
214 pbmi
->bmiColors
[1].rgbGreen
= 0;
215 pbmi
->bmiColors
[1].rgbBlue
= 0xff;
217 hdib
= CreateDIBSection(hdc
, pbmi
, DIB_RGB_COLORS
, (void**)&bits
, NULL
, 0);
218 ok(hdib
!= NULL
, "CreateDIBSection failed\n");
220 /* Test if the old BITMAPCOREINFO structure is supported */
222 pbci
->bmciHeader
.bcSize
= sizeof(BITMAPCOREHEADER
);
223 pbci
->bmciHeader
.bcBitCount
= 0;
226 ret
= GetDIBits(hdc
, hdib
, 0, 16, NULL
, (BITMAPINFO
*) pbci
, DIB_RGB_COLORS
);
227 ok(ret
, "GetDIBits doesn't work with a BITMAPCOREHEADER\n");
228 ok((pbci
->bmciHeader
.bcWidth
== 16) && (pbci
->bmciHeader
.bcHeight
== 16)
229 && (pbci
->bmciHeader
.bcBitCount
== 1) && (pbci
->bmciHeader
.bcPlanes
== 1),
230 "GetDIBits did't fill in the BITMAPCOREHEADER structure properly\n");
232 ret
= GetDIBits(hdc
, hdib
, 0, 16, &coreBits
, (BITMAPINFO
*) pbci
, DIB_RGB_COLORS
);
233 ok(ret
, "GetDIBits doesn't work with a BITMAPCOREHEADER\n");
234 ok((pbci
->bmciColors
[0].rgbtRed
== 0xff) && (pbci
->bmciColors
[0].rgbtGreen
== 0) &&
235 (pbci
->bmciColors
[0].rgbtBlue
== 0) && (pbci
->bmciColors
[1].rgbtRed
== 0) &&
236 (pbci
->bmciColors
[1].rgbtGreen
== 0) && (pbci
->bmciColors
[1].rgbtBlue
== 0xff),
237 "The color table has not been translated to the old BITMAPCOREINFO format\n");
239 hcoredib
= CreateDIBSection(hdc
, (BITMAPINFO
*) pbci
, DIB_RGB_COLORS
, (void**)&bits
, NULL
, 0);
240 ok(hcoredib
!= NULL
, "CreateDIBSection failed with a BITMAPCOREINFO\n");
242 ZeroMemory(pbci
->bmciColors
, 256 * sizeof(RGBTRIPLE
));
243 ret
= GetDIBits(hdc
, hcoredib
, 0, 16, &coreBits
, (BITMAPINFO
*) pbci
, DIB_RGB_COLORS
);
244 ok(ret
, "GetDIBits doesn't work with a BITMAPCOREHEADER\n");
245 ok((pbci
->bmciColors
[0].rgbtRed
== 0xff) && (pbci
->bmciColors
[0].rgbtGreen
== 0) &&
246 (pbci
->bmciColors
[0].rgbtBlue
== 0) && (pbci
->bmciColors
[1].rgbtRed
== 0) &&
247 (pbci
->bmciColors
[1].rgbtGreen
== 0) && (pbci
->bmciColors
[1].rgbtBlue
== 0xff),
248 "The color table has not been translated to the old BITMAPCOREINFO format\n");
250 DeleteObject(hcoredib
);
253 hdcmem
= CreateCompatibleDC(hdc
);
254 oldbm
= SelectObject(hdcmem
, hdib
);
256 ret
= GetDIBColorTable(hdcmem
, 0, 2, rgb
);
257 ok(ret
== 2, "GetDIBColorTable returned %d\n", ret
);
258 ok(!memcmp(rgb
, pbmi
->bmiColors
, 2 * sizeof(RGBQUAD
)),
259 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
260 rgb
[0].rgbRed
, rgb
[0].rgbGreen
, rgb
[0].rgbBlue
, rgb
[0].rgbReserved
,
261 rgb
[1].rgbRed
, rgb
[1].rgbGreen
, rgb
[1].rgbBlue
, rgb
[1].rgbReserved
);
263 c0
= RGB(pbmi
->bmiColors
[0].rgbRed
, pbmi
->bmiColors
[0].rgbGreen
, pbmi
->bmiColors
[0].rgbBlue
);
264 c1
= RGB(pbmi
->bmiColors
[1].rgbRed
, pbmi
->bmiColors
[1].rgbGreen
, pbmi
->bmiColors
[1].rgbBlue
);
266 test_color(hdcmem
, DIBINDEX(0), c0
, 0, 1);
267 test_color(hdcmem
, DIBINDEX(1), c1
, 0, 1);
268 test_color(hdcmem
, DIBINDEX(2), c0
, 1, 1);
269 test_color(hdcmem
, PALETTEINDEX(0), c0
, 1, 1);
270 test_color(hdcmem
, PALETTEINDEX(1), c0
, 1, 1);
271 test_color(hdcmem
, PALETTEINDEX(2), c0
, 1, 1);
272 test_color(hdcmem
, PALETTERGB(pbmi
->bmiColors
[0].rgbRed
, pbmi
->bmiColors
[0].rgbGreen
,
273 pbmi
->bmiColors
[0].rgbBlue
), c0
, 1, 1);
274 test_color(hdcmem
, PALETTERGB(pbmi
->bmiColors
[1].rgbRed
, pbmi
->bmiColors
[1].rgbGreen
,
275 pbmi
->bmiColors
[1].rgbBlue
), c1
, 1, 1);
276 test_color(hdcmem
, PALETTERGB(0, 0, 0), c0
, 1, 1);
277 test_color(hdcmem
, PALETTERGB(0xff, 0xff, 0xff), c0
, 1, 1);
278 test_color(hdcmem
, PALETTERGB(0, 0, 0xfe), c1
, 1, 1);
280 SelectObject(hdcmem
, oldbm
);
283 pbmi
->bmiHeader
.biBitCount
= 8;
285 for (i
= 0; i
< 128; i
++) {
286 pbmi
->bmiColors
[i
].rgbRed
= 255 - i
* 2;
287 pbmi
->bmiColors
[i
].rgbGreen
= i
* 2;
288 pbmi
->bmiColors
[i
].rgbBlue
= 0;
289 pbmi
->bmiColors
[255 - i
].rgbRed
= 0;
290 pbmi
->bmiColors
[255 - i
].rgbGreen
= i
* 2;
291 pbmi
->bmiColors
[255 - i
].rgbBlue
= 255 - i
* 2;
293 hdib
= CreateDIBSection(hdcmem
, pbmi
, DIB_RGB_COLORS
, (void**)&bits
, NULL
, 0);
294 ok(hdib
!= NULL
, "CreateDIBSection failed\n");
295 oldbm
= SelectObject(hdcmem
, hdib
);
297 for (i
= 0; i
< 256; i
++) {
298 test_color(hdcmem
, DIBINDEX(i
),
299 RGB(pbmi
->bmiColors
[i
].rgbRed
, pbmi
->bmiColors
[i
].rgbGreen
, pbmi
->bmiColors
[i
].rgbBlue
), 0, 0);
300 test_color(hdcmem
, PALETTERGB(pbmi
->bmiColors
[i
].rgbRed
, pbmi
->bmiColors
[i
].rgbGreen
, pbmi
->bmiColors
[i
].rgbBlue
),
301 RGB(pbmi
->bmiColors
[i
].rgbRed
, pbmi
->bmiColors
[i
].rgbGreen
, pbmi
->bmiColors
[i
].rgbBlue
), 0, 0);
304 SelectObject(hdcmem
, oldbm
);
307 pbmi
->bmiHeader
.biBitCount
= 1;
309 /* Now create a palette and a palette indexed dib section */
310 memset(plogpal
, 0, sizeof(logpalbuf
));
311 plogpal
->palVersion
= 0x300;
312 plogpal
->palNumEntries
= 2;
313 plogpal
->palPalEntry
[0].peRed
= 0xff;
314 plogpal
->palPalEntry
[0].peBlue
= 0xff;
315 plogpal
->palPalEntry
[1].peGreen
= 0xff;
317 index
= (WORD
*)pbmi
->bmiColors
;
320 hpal
= CreatePalette(plogpal
);
321 ok(hpal
!= NULL
, "CreatePalette failed\n");
322 oldpal
= SelectPalette(hdc
, hpal
, TRUE
);
323 hdib
= CreateDIBSection(hdc
, pbmi
, DIB_PAL_COLORS
, (void**)&bits
, NULL
, 0);
324 ok(hdib
!= NULL
, "CreateDIBSection failed\n");
326 /* The colour table has already been grabbed from the dc, so we select back the
329 SelectPalette(hdc
, oldpal
, TRUE
);
330 oldbm
= SelectObject(hdcmem
, hdib
);
331 oldpal
= SelectPalette(hdcmem
, hpal
, TRUE
);
333 ret
= GetDIBColorTable(hdcmem
, 0, 2, rgb
);
334 ok(ret
== 2, "GetDIBColorTable returned %d\n", ret
);
335 ok(rgb
[0].rgbRed
== 0xff && rgb
[0].rgbBlue
== 0xff && rgb
[0].rgbGreen
== 0 &&
336 rgb
[1].rgbRed
== 0 && rgb
[1].rgbBlue
== 0 && rgb
[1].rgbGreen
== 0xff,
337 "GetDIBColorTable returns table 0: r%02x g%02x b%02x res%02x 1: r%02x g%02x b%02x res%02x\n",
338 rgb
[0].rgbRed
, rgb
[0].rgbGreen
, rgb
[0].rgbBlue
, rgb
[0].rgbReserved
,
339 rgb
[1].rgbRed
, rgb
[1].rgbGreen
, rgb
[1].rgbBlue
, rgb
[1].rgbReserved
);
341 c0
= RGB(plogpal
->palPalEntry
[0].peRed
, plogpal
->palPalEntry
[0].peGreen
, plogpal
->palPalEntry
[0].peBlue
);
342 c1
= RGB(plogpal
->palPalEntry
[1].peRed
, plogpal
->palPalEntry
[1].peGreen
, plogpal
->palPalEntry
[1].peBlue
);
344 test_color(hdcmem
, DIBINDEX(0), c0
, 0, 1);
345 test_color(hdcmem
, DIBINDEX(1), c1
, 0, 1);
346 test_color(hdcmem
, DIBINDEX(2), c0
, 1, 1);
347 test_color(hdcmem
, PALETTEINDEX(0), c0
, 0, 1);
348 test_color(hdcmem
, PALETTEINDEX(1), c1
, 0, 1);
349 test_color(hdcmem
, PALETTEINDEX(2), c0
, 1, 1);
350 test_color(hdcmem
, PALETTERGB(plogpal
->palPalEntry
[0].peRed
, plogpal
->palPalEntry
[0].peGreen
,
351 plogpal
->palPalEntry
[0].peBlue
), c0
, 1, 1);
352 test_color(hdcmem
, PALETTERGB(plogpal
->palPalEntry
[1].peRed
, plogpal
->palPalEntry
[1].peGreen
,
353 plogpal
->palPalEntry
[1].peBlue
), c1
, 1, 1);
354 test_color(hdcmem
, PALETTERGB(0, 0, 0), c1
, 1, 1);
355 test_color(hdcmem
, PALETTERGB(0xff, 0xff, 0xff), c0
, 1, 1);
356 test_color(hdcmem
, PALETTERGB(0, 0, 0xfe), c0
, 1, 1);
357 test_color(hdcmem
, PALETTERGB(0, 1, 0), c1
, 1, 1);
358 test_color(hdcmem
, PALETTERGB(0x3f, 0, 0x3f), c1
, 1, 1);
359 test_color(hdcmem
, PALETTERGB(0x40, 0, 0x40), c0
, 1, 1);
361 /* Bottom and 2nd row from top green, everything else magenta */
362 bits
[0] = bits
[1] = 0xff;
363 bits
[13 * 4] = bits
[13*4 + 1] = 0xff;
366 pbmi
->bmiHeader
.biBitCount
= 32;
368 hdib2
= CreateDIBSection(NULL
, pbmi
, DIB_RGB_COLORS
, (void **)&bits32
, NULL
, 0);
369 ok(hdib2
!= NULL
, "CreateDIBSection failed\n");
370 hdcmem2
= CreateCompatibleDC(hdc
);
371 oldbm2
= SelectObject(hdcmem2
, hdib2
);
373 BitBlt(hdcmem2
, 0, 0, 16,16, hdcmem
, 0, 0, SRCCOPY
);
375 ok(bits32
[0] == 0xff00, "lower left pixel is %08lx\n", bits32
[0]);
376 ok(bits32
[17] == 0xff00ff, "bottom but one, left pixel is %08lx\n", bits32
[17]);
378 SelectObject(hdcmem2
, oldbm2
);
381 SelectObject(hdcmem
, oldbm
);
382 SelectObject(hdcmem
, oldpal
);
387 pbmi
->bmiHeader
.biBitCount
= 8;
389 memset(plogpal
, 0, sizeof(logpalbuf
));
390 plogpal
->palVersion
= 0x300;
391 plogpal
->palNumEntries
= 256;
393 for (i
= 0; i
< 128; i
++) {
394 plogpal
->palPalEntry
[i
].peRed
= 255 - i
* 2;
395 plogpal
->palPalEntry
[i
].peBlue
= i
* 2;
396 plogpal
->palPalEntry
[i
].peGreen
= 0;
397 plogpal
->palPalEntry
[255 - i
].peRed
= 0;
398 plogpal
->palPalEntry
[255 - i
].peGreen
= i
* 2;
399 plogpal
->palPalEntry
[255 - i
].peBlue
= 255 - i
* 2;
402 index
= (WORD
*)pbmi
->bmiColors
;
403 for (i
= 0; i
< 256; i
++) {
407 hpal
= CreatePalette(plogpal
);
408 ok(hpal
!= NULL
, "CreatePalette failed\n");
409 oldpal
= SelectPalette(hdc
, hpal
, TRUE
);
410 hdib
= CreateDIBSection(hdc
, pbmi
, DIB_PAL_COLORS
, (void**)&bits
, NULL
, 0);
411 ok(hdib
!= NULL
, "CreateDIBSection failed\n");
413 SelectPalette(hdc
, oldpal
, TRUE
);
414 oldbm
= SelectObject(hdcmem
, hdib
);
415 oldpal
= SelectPalette(hdcmem
, hpal
, TRUE
);
417 ret
= GetDIBColorTable(hdcmem
, 0, 256, rgb
);
418 ok(ret
== 256, "GetDIBColorTable returned %d\n", ret
);
419 for (i
= 0; i
< 256; i
++) {
420 ok(rgb
[i
].rgbRed
== plogpal
->palPalEntry
[i
].peRed
&&
421 rgb
[i
].rgbBlue
== plogpal
->palPalEntry
[i
].peBlue
&&
422 rgb
[i
].rgbGreen
== plogpal
->palPalEntry
[i
].peGreen
,
423 "GetDIBColorTable returns table %d: r%02x g%02x b%02x res%02x\n",
424 i
, rgb
[i
].rgbRed
, rgb
[i
].rgbGreen
, rgb
[i
].rgbBlue
, rgb
[i
].rgbReserved
);
427 for (i
= 0; i
< 256; i
++) {
428 test_color(hdcmem
, DIBINDEX(i
),
429 RGB(plogpal
->palPalEntry
[i
].peRed
, plogpal
->palPalEntry
[i
].peGreen
, plogpal
->palPalEntry
[i
].peBlue
), 0, 0);
430 test_color(hdcmem
, PALETTEINDEX(i
),
431 RGB(plogpal
->palPalEntry
[i
].peRed
, plogpal
->palPalEntry
[i
].peGreen
, plogpal
->palPalEntry
[i
].peBlue
), 0, 0);
432 test_color(hdcmem
, PALETTERGB(plogpal
->palPalEntry
[i
].peRed
, plogpal
->palPalEntry
[i
].peGreen
, plogpal
->palPalEntry
[i
].peBlue
),
433 RGB(plogpal
->palPalEntry
[i
].peRed
, plogpal
->palPalEntry
[i
].peGreen
, plogpal
->palPalEntry
[i
].peBlue
), 0, 0);
436 SelectPalette(hdcmem
, oldpal
, TRUE
);
437 SelectObject(hdcmem
, oldbm
);
450 hWnd
= CreateWindowExA(0, "EDIT", NULL
, 0,
452 NULL
, NULL
, NULL
, NULL
);
454 is_win9x
= GetWindowLongPtrW(hWnd
, GWLP_WNDPROC
) == 0;
457 test_createdibitmap();