Vincent Povirk : gdiplus: Don' t require an HDC to get the resolution of a graphics object.
Module: wine Branch: master Commit: 963c7090d558a7bd2991e13620b1112348a921df URL: http://source.winehq.org/git/wine.git/?a=commit;h=963c7090d558a7bd2991e13620... Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Sun Aug 8 15:53:08 2010 -0500 gdiplus: Don't require an HDC to get the resolution of a graphics object. --- dlls/gdiplus/graphics.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index ccec25d..79290b5 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4574,7 +4574,10 @@ GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL* dpi) if(graphics->busy) return ObjectBusy; - *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX); + if (graphics->image) + *dpi = graphics->image->xres; + else + *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX); return Ok; } @@ -4589,7 +4592,10 @@ GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL* dpi) if(graphics->busy) return ObjectBusy; - *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY); + if (graphics->image) + *dpi = graphics->image->yres; + else + *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY); return Ok; }
participants (1)
-
Alexandre Julliard