[cairo] Image will not rotate

Gerdus van Zyl gerdusvanzyl at gmail.com
Fri Apr 3 09:49:57 PDT 2009

You need to apply your rotation on the pattern (the image) matrix;
from the api docs:
"Note: The pattern's transformation matrix will be locked to the user
space in effect at the time of cairo_set_source(). This means that
further modifications of the current transformation matrix will not
affect the source pattern."

So the easiest would be to set the rotation before calling set_source
The longer way you need to get the matrix of the pattern
(cairo_get_source), then use cairo_pattern_get_matrix
,cairo_matrix_rotate and cairo_pattern_set_matrix (Note C api c++ api
should have similar things as object methods)

On Fri, Apr 3, 2009 at 5:50 PM, Evan White <talguy385 at gmail.com> wrote:
> I am current building an app that will be a replacement for your vehicles
> instrument cluster as my senior design project.  This app allows the user to
> load custom skins based off PNG images.  Each gauge is stored in a list.
>  When updating the interface the system searches the list and fines the
> gauge fine.  It generated the correct angle given input value.  The problem
> is that it does not rotate the image at all.  The dashboard class is the
> controller for exposing the window and the analog class is where the actual
> image is being processed and rotated.  I am not a computer science major I
> am an electrical engineering one so please mind the poor programming
> practices that are used in the code.  If you want to make suggestions that
> would be great, but I have no clue why my image is not rotating.
> Evan
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo

More information about the cairo mailing list