gdiplus: Don't require an HDC to get the resolution of a graphics object.
This commit is contained in:
parent
c3ca6be2b9
commit
963c7090d5
|
@ -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)
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue