[cairo] Dimensions of a "surface_t"
ranma42 at gmail.com
Tue Nov 8 23:57:46 PST 2011
On Wed, Nov 9, 2011 at 12:32 AM, Charles Doutriaux <doutriaux1 at llnl.gov> wrote:
> I'm receiving a cairo_t, I can get the surface via cairo_get_target
> Now I would like to know what the dimensions of the "surface" is, if it is
> an image i can use:
> But I also get surface that ar PS, PDF or SVG
> All of these are created with dims:
> surface = cairo_ps_surface_create_for_stream(stream_cairo_write,
> Is it possible to retrieve what the original dims/size were?
cairo_clip_extents (cr, &x1, &y1, &x2, &y2);
should give you the size of the surface.
Remember that this will give you the size of the group target, not of
the "original" target.
I believe that to get the size of the original target, you have to
wrap it in a new cairo_t and ask for its clip extents.
> cairo mailing list
> cairo at cairographics.org
More information about the cairo