ReactOS 0.4.15-dev-5666-gc548b97
GetPixel.c
Go to the documentation of this file.
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 "precomp.h"
9
11{
12 HDC hdc;
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
45}
46
48{
50}
void Test_GetPixel_1bpp()
Definition: GetPixel.c:10
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
HBITMAP hbmp
#define NULL
Definition: types.h:112
pKey DeleteObject()
GLuint buffer
Definition: glext.h:5915
GLuint color
Definition: glext.h:6243
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
unsigned int UINT
Definition: ndis.h:50
DWORD COLORREF
Definition: windef.h:300
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
BOOL WINAPI DeleteDC(_In_ HDC)