ReactOS  0.4.15-dev-3428-g0609db5
GetPixel.c File Reference
#include "precomp.h"
Include dependency graph for GetPixel.c:

Go to the source code of this file.

Functions

void Test_GetPixel_1bpp ()
 
 START_TEST (GetPixel)
 

Function Documentation

◆ START_TEST()

START_TEST ( GetPixel  )

Definition at line 47 of file GetPixel.c.

48 {
50 }
void Test_GetPixel_1bpp()
Definition: GetPixel.c:10

◆ Test_GetPixel_1bpp()

void Test_GetPixel_1bpp ( )

Definition at line 10 of file GetPixel.c.

11 {
12  HDC hdc;
13  HBITMAP hbmp;
14  char buffer[] = {0x80, 0x0};
16 
17  hbmp = CreateBitmap(2,1,1,1,buffer);
18  ok(hbmp != NULL, "Failed to create a monochrom bitmap...\n");
21  ok(hbmp != NULL, "Could not select the bitmap into the DC.\n");
22 
23  color = GetPixel(hdc, 0, 0);
24  ok(color == 0xFFFFFF, "Wrong color at 0,0 : 0x%08x\n", (UINT)color);
25  color = GetPixel(hdc, 1, 0);
26  ok(color == 0, "Wrong color at 1,0 : 0x%08x\n", (UINT)color);
27 
28  SetBkColor(hdc, 0x0000FF);
29  SetTextColor(hdc, 0x00FF00);
30  color = GetPixel(hdc, 0, 0);
31  ok(color == 0xFFFFFF, "Wrong color at 0,0 : 0x%08x\n", (UINT)color);
32  color = GetPixel(hdc, 1, 0);
33  ok(color == 0, "Wrong color at 1,0 : 0x%08x\n", (UINT)color);
34 
35  SetBkColor(hdc, 0x12345678);
36  SetTextColor(hdc, 0x87654321);
37  color = GetPixel(hdc, 0, 0);
38  ok(color == 0xFFFFFF, "Wrong color at 0,0 : 0x%08x\n", (UINT)color);
39  color = GetPixel(hdc, 1, 0);
40  ok(color == 0, "Wrong color at 1,0 : 0x%08x\n", (UINT)color);
41 
44  DeleteDC(hdc);
45 }
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLuint buffer
Definition: glext.h:5915
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
GLuint color
Definition: glext.h:6243
HBITMAP hbmp
DWORD COLORREF
Definition: windef.h:300
HDC hdc
Definition: main.c:9
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:911
BOOL WINAPI DeleteDC(_In_ HDC)
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
static HBITMAP
Definition: button.c:44
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)

Referenced by START_TEST().