[GDI32_APITEST]
[reactos.git] / rostests / apitests / gdi32 / GetPixel.c
1 /*
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
6 */
7
8 #include <stdio.h>
9 #include <wine/test.h>
10 #include <windows.h>
11
12
13 void Test_GetPixel_1bpp()
14 {
15 HDC hdc;
16 HBITMAP hbmp;
17 char buffer[] = {0x80, 0x0};
18 COLORREF color;
19
20 hbmp = CreateBitmap(2,1,1,1,buffer);
21 ok(hbmp != NULL, "Failed to create a monochrom bitmap...\n");
22 hdc = CreateCompatibleDC(0);
23 hbmp = SelectObject(hdc, hbmp);
24 ok(hbmp != NULL, "Could not select the bitmap into the DC.\n");
25
26 color = GetPixel(hdc, 0, 0);
27 ok(color == 0xFFFFFF, "Wrong color at 0,0 : 0x%08x\n", (UINT)color);
28 color = GetPixel(hdc, 1, 0);
29 ok(color == 0, "Wrong color at 1,0 : 0x%08x\n", (UINT)color);
30
31 hbmp = SelectObject(hdc, hbmp);
32 DeleteObject(hbmp);
33 DeleteDC(hdc);
34 }
35
36 START_TEST(GetPixel)
37 {
38 Test_GetPixel_1bpp();
39 }