2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for GetPixel
5 * PROGRAMMERS: Jérôme Gardou
12 void Test_GetPixel_1bpp()
16 char buffer
[] = {0x80, 0x0};
19 hbmp
= CreateBitmap(2,1,1,1,buffer
);
20 ok(hbmp
!= NULL
, "Failed to create a monochrom bitmap...\n");
21 hdc
= CreateCompatibleDC(0);
22 hbmp
= SelectObject(hdc
, hbmp
);
23 ok(hbmp
!= NULL
, "Could not select the bitmap into the DC.\n");
25 color
= GetPixel(hdc
, 0, 0);
26 ok(color
== 0xFFFFFF, "Wrong color at 0,0 : 0x%08x\n", (UINT
)color
);
27 color
= GetPixel(hdc
, 1, 0);
28 ok(color
== 0, "Wrong color at 1,0 : 0x%08x\n", (UINT
)color
);
30 SetBkColor(hdc
, 0x0000FF);
31 SetTextColor(hdc
, 0x00FF00);
32 color
= GetPixel(hdc
, 0, 0);
33 ok(color
== 0xFFFFFF, "Wrong color at 0,0 : 0x%08x\n", (UINT
)color
);
34 color
= GetPixel(hdc
, 1, 0);
35 ok(color
== 0, "Wrong color at 1,0 : 0x%08x\n", (UINT
)color
);
37 SetBkColor(hdc
, 0x12345678);
38 SetTextColor(hdc
, 0x87654321);
39 color
= GetPixel(hdc
, 0, 0);
40 ok(color
== 0xFFFFFF, "Wrong color at 0,0 : 0x%08x\n", (UINT
)color
);
41 color
= GetPixel(hdc
, 1, 0);
42 ok(color
== 0, "Wrong color at 1,0 : 0x%08x\n", (UINT
)color
);
44 hbmp
= SelectObject(hdc
, hbmp
);