[cairo] Can cairo work with win32 SetMapMode

Adrian Johnson ajohnson at redneon.com
Wed Aug 20 06:42:05 PDT 2014


On 19/08/14 17:29, fiveight wrote:
> Can cairo work with win32 SetMapMode?

No. You will need to call GetDeviceCaps to get the pixels per inch then
set the cairo scale. Something like:

    int x = GetDeviceCaps(hdc, LOGPIXELSX);
    int y = GetDeviceCaps(hdc, LOGPIXELSY);
    cairo_scale(0.1*x/25.4, 0.1*y/25.4); /* 1 unit is 0.1 mm */



More information about the cairo mailing list