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

Carl Worth cworth at cworth.org
Wed Feb 15 08:28:06 PST 2006


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);

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060215/3a394862/attachment.pgp


More information about the cairo mailing list