gdiplus: Don't require an HDC to get the resolution of a graphics object.
This commit is contained in:
parent
c3ca6be2b9
commit
963c7090d5
|
@ -4574,7 +4574,10 @@ GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL* dpi)
|
||||||
if(graphics->busy)
|
if(graphics->busy)
|
||||||
return ObjectBusy;
|
return ObjectBusy;
|
||||||
|
|
||||||
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX);
|
if (graphics->image)
|
||||||
|
*dpi = graphics->image->xres;
|
||||||
|
else
|
||||||
|
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX);
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
@ -4589,7 +4592,10 @@ GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL* dpi)
|
||||||
if(graphics->busy)
|
if(graphics->busy)
|
||||||
return ObjectBusy;
|
return ObjectBusy;
|
||||||
|
|
||||||
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY);
|
if (graphics->image)
|
||||||
|
*dpi = graphics->image->yres;
|
||||||
|
else
|
||||||
|
*dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY);
|
||||||
|
|
||||||
return Ok;
|
return Ok;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue