[cairo] Image basic data

Daniel Amelang daniel.amelang at gmail.com
Sun Mar 11 23:20:55 PDT 2007

On 3/8/07, Leonel Salazar Videaux <lsalazar at estudiantes.uci.cu> wrote:
> How can I know the basic image or picture data using cairo?, I mean, i need to get some memory in a buffer and for do that i need to know data such as width and height, i just want to know how to get this information from a PNG of SVG file.

Hi Leonel, I'm not exactly sure what you're asking here. Are you just
trying to determine the width and height of an image stored in the png
format? I suppose that you can load an image surface with a call to
cairo_image_surface_create_from_png, then get the width and height via
cairo_image_surface_get_width and cairo_image_surface_get_height.
Although, if that's all you need, cairo really is overkill. There are
more lightweight ways of doing this.

Hope that helps,


More information about the cairo mailing list