[cairo] how to rotate a picture

Bill Spitzak spitzak at thefoundry.co.uk
Wed Jul 18 02:26:30 PDT 2007


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



More information about the cairo mailing list