[cairo] how to rotate a picture
jacky
gtkdict at yahoo.com.cn
Thu Jul 19 01:48:46 PDT 2007
It should be:
cairo_translate(cr, any_value, any_value);
cairo_rotate(cr, angle);
cairo_set_source_surface (cr, surface, -width/2,
-height/2);
--- Bill Spitzak <spitzak at thefoundry.co.uk>wrote:
> fitren wrote:
> > Hi:
> > I want to rotate a "png" picture,I used
> "cairo_rotate" to do it,it did rotate ,but it
> rotated surrounded with the left top corner.
> > The question is :how to rotate it surrounded by
> the middle of the picture?
>
> cairo_translate(cairo_t, -width/2,-height/2);
> cairo_rotate(cairo_t, angle);
> cairo_translate(cairo_t, width/2, height/2);
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
>
http://lists.cairographics.org/mailman/listinfo/cairo
>
___________________________________________________________
抢注雅虎免费邮箱3.5G容量,20M附件!
http://cn.mail.yahoo.com
More information about the cairo
mailing list