gdiplus: Implement GdipBitmapSetResolution.

This commit is contained in:
Vincent Povirk 2009-12-26 21:05:58 -05:00 committed by Alexandre Julliard
parent 1aea88cac1
commit 6bb300fa41
2 changed files with 13 additions and 7 deletions

View File

@ -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,

View File

@ -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);