[cairo] image alignment

Carl Worth cworth at cworth.org
Thu Apr 24 20:51:00 PDT 2008


On Thu, 24 Apr 2008 16:00:14 +0600, Alexei Babich wrote:
> cairo_set_source_surface (cr, src_image, 0,0);

The (0,0) in the function call above is where the (0,0) placement of
the image is coming from. You can put (10,10) or any other coordinates
you would like to there to place the image differently.

> cairo_rectangle(cr, 0,0,size_x,size_y);		//wuthout this cairo do nothing
>
> cairo_fill(cr);		//fill src surface to target surface

Actually, "cairo_fill" fills the current path, (which is the rectangle
you just created). If you don't have that rectangle there, then you
can still paint the source surface by simply doing cairo_paint(cr)
instead of cairo_fill(cr);

I hope that helps. Do have fun with cairo!

-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.cairographics.org/archives/cairo/attachments/20080424/8e2d9a1e/attachment.pgp 


More information about the cairo mailing list