Commit 963c7090 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Don't require an HDC to get the resolution of a graphics object.

parent c3ca6be2
...@@ -4574,6 +4574,9 @@ GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL* dpi) ...@@ -4574,6 +4574,9 @@ GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL* dpi)
if(graphics->busy) if(graphics->busy)
return ObjectBusy; return ObjectBusy;
if (graphics->image)
*dpi = graphics->image->xres;
else
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX); *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX);
return Ok; return Ok;
...@@ -4589,6 +4592,9 @@ GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL* dpi) ...@@ -4589,6 +4592,9 @@ GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL* dpi)
if(graphics->busy) if(graphics->busy)
return ObjectBusy; return ObjectBusy;
if (graphics->image)
*dpi = graphics->image->yres;
else
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY); *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY);
return Ok; return Ok;
......
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