[cairo] Copying from one surface to another

Richenderfer, Tom Tom.Richenderfer at xerox.com
Fri Feb 3 11:49:08 PST 2012


Thanks, Adrian.  That did the trick.  I thought I had tried that, but I
must have muffed it somehow.

-----Original Message-----
From: Adrian Johnson [mailto:ajohnson at redneon.com] 
Sent: Friday, February 03, 2012 3:25 AM
To: Richenderfer, Tom
Cc: cairo at cairographics.org
Subject: Re: [cairo] Copying from one surface to another

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