[cairo] Copying from one surface to another

Adrian Johnson ajohnson at redneon.com
Fri Feb 3 00:24:54 PST 2012


On 03/02/12 07:51, Richenderfer, Tom wrote:
> All,
>                 I have discovered the basic problem that I am running
> into with this application.  The PNG files were created for 600 dpi and
> I want the PS output created for 600 dpi, but it appears the PS output
> is getting created for something like 72 dpi.  Is it possible to tell
> the psSurface that it should be rendering the image data for a
> particular resolution?  I have tried
> cairo_surface_set_fallback_resolution on the psSurface, but it had no
> effect.

The image surface uses units of 1 unit = 1 pixel. The PS surface uses
units of 1 unit = 1 point (1 point = 1/72 inch). If you don't alter the
scale when painting an image to the PS surface, each pixel will be 1/72"
in size resulting a resolution of 72 pixels per inch. You can change the
scale with cairo_scale(). To obtain a scale of 600 ppi you would scale
the x and y axes by 72/600.


More information about the cairo mailing list