oleaut32/tests: Testcase for IPicture_Render with icons, check for drawing size and position.
This commit is contained in:
parent
faa451628a
commit
57b55a661d
|
@ -594,6 +594,9 @@ static void test_Render(void)
|
|||
HRESULT hres;
|
||||
short type;
|
||||
PICTDESC desc;
|
||||
OLE_XSIZE_HIMETRIC pWidth;
|
||||
OLE_YSIZE_HIMETRIC pHeight;
|
||||
COLORREF result;
|
||||
HDC hdc = GetDC(0);
|
||||
|
||||
/* test IPicture::Render return code on uninitialized picture */
|
||||
|
@ -646,8 +649,28 @@ static void test_Render(void)
|
|||
ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE);
|
||||
hres = IPicture_Render(pic, hdc, 0, 0, 0, 0, 0, 0, 10, 10, NULL);
|
||||
ole_expect(hres, CTL_E_INVALIDPROPERTYVALUE);
|
||||
IPicture_Release(pic);
|
||||
|
||||
/* Check if target size and position is respected */
|
||||
IPicture_get_Width(pic, &pWidth);
|
||||
IPicture_get_Height(pic, &pHeight);
|
||||
|
||||
SetPixelV(hdc, 0, 0, 0x00F0F0F0);
|
||||
SetPixelV(hdc, 5, 5, 0x00F0F0F0);
|
||||
SetPixelV(hdc, 10, 10, 0x00F0F0F0);
|
||||
|
||||
IPicture_Render(pic, hdc, 1, 1, 9, 9, 0, 0, pWidth, -pHeight, NULL);
|
||||
|
||||
result = GetPixel(hdc, 0, 0);
|
||||
ok(result == 0x00F0F0F0,
|
||||
"Color at 0,0 should be unchanged 0xF0F0F0, but was 0x%06X\n", result);
|
||||
result = GetPixel(hdc, 5, 5);
|
||||
ok(result != 0x00F0F0F0,
|
||||
"Color at 5,5 should have changed, but still was 0x%06X\n", result);
|
||||
result = GetPixel(hdc, 10, 10);
|
||||
todo_wine ok(result == 0x00F0F0F0,
|
||||
"Color at 10,10 should be unchanged 0xF0F0F0, but was 0x%06X\n", result);
|
||||
|
||||
IPicture_Release(pic);
|
||||
ReleaseDC(NULL, hdc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue