From 4fb0cc4ce7088ce191998c135c6e7cf5582ece1d Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sun, 8 Aug 2010 15:53:08 -0500 Subject: [PATCH 4/5] 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; } -- 1.7.0.4