[cairo] Image will not rotate
Evan White
talguy385 at gmail.com
Fri Apr 3 11:51:05 PDT 2009
I look at the C programing samples posted on the Cairo site and saw that
set_source is usually called after the rotation function. So before I
posted my first post I tried it and all I got was a black screen. No
image was painted to the window. Not the background or any of the gauge
needles.
Evan
Gerdus van Zyl said the following On 4/3/2009 12:49 PM:
> 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