[cairo] How to put RGB(A) data on a cairo context?

Lutz Müller lutz at topfrose.de
Thu Feb 16 11:20:43 PST 2006


On Wed, 2006-02-15 at 08:28 -0800, Carl Worth wrote:
> On Wed, 15 Feb 2006 16:33:44 +0100, Lutz Müller wrote:
> > I am wondering how to put RGB(A) data on a cairo context? Take a text
> > document with a picture embedded. How do I draw that picture on the
> > cairo context?
> 
> First, you'll need to get a surface that contains the data of
> interest. See:
> 
> 	cairo_image_surface_create_for_data
> 
> Once you've got that, it's a fairly simple matter to paint it at
> user-space position (x, y):
> 
> 	cairo_set_source_surface (cr, data_surface, x, y);
> 	cairo_paint (cr);

Thanks. That helped a lot:
http://bugzilla.gnome.org/show_bug.cgi?id=331420

-- 
Lutz Müller <lutz at topfrose.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060216/7301ce5c/attachment.pgp


More information about the cairo mailing list