Commit 6bb300fa authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Implement GdipBitmapSetResolution.

parent 1aea88ca
......@@ -535,9 +535,15 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect,
GpStatus WINGDIPAPI GdipBitmapSetResolution(GpBitmap* bitmap, REAL xdpi, REAL ydpi)
{
FIXME("(%p, %.2f, %.2f)\n", bitmap, xdpi, ydpi);
TRACE("(%p, %.2f, %.2f)\n", bitmap, xdpi, ydpi);
return NotImplemented;
if (!bitmap || xdpi == 0.0 || ydpi == 0.0)
return InvalidParameter;
bitmap->image.xres = xdpi;
bitmap->image.yres = ydpi;
return Ok;
}
GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
......
......@@ -915,10 +915,10 @@ static void test_resolution(void)
expect(InvalidParameter, stat);
stat = GdipBitmapSetResolution(NULL, 96.0, 96.0);
todo_wine expect(InvalidParameter, stat);
expect(InvalidParameter, stat);
stat = GdipBitmapSetResolution(bitmap, 0.0, 0.0);
todo_wine expect(InvalidParameter, stat);
expect(InvalidParameter, stat);
/* defaults to screen resolution */
screendc = GetDC(0);
......@@ -938,15 +938,15 @@ static void test_resolution(void)
/* test changing the resolution */
stat = GdipBitmapSetResolution(bitmap, screenxres*2.0, screenyres*3.0);
todo_wine expect(Ok, stat);
expect(Ok, stat);
stat = GdipGetImageHorizontalResolution((GpImage*)bitmap, &res);
expect(Ok, stat);
todo_wine expectf(screenxres*2.0, res);
expectf(screenxres*2.0, res);
stat = GdipGetImageVerticalResolution((GpImage*)bitmap, &res);
expect(Ok, stat);
todo_wine expectf(screenyres*3.0, res);
expectf(screenyres*3.0, res);
stat = GdipDisposeImage((GpImage*)bitmap);
expect(Ok, stat);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment