[Mono-list] help wanted with Cairo - fairly inexperienced user

alanb alan.battersby at ntlworld.com
Wed Oct 28 16:53:38 EDT 2009


Hi,
I am happy with using cairo for basic drawing. My problem is that I have
drawn a circular grid which is quite dense (spokes every 10 degrees, circles
every 10 mm from 10 to 200mm radius) it uses transformations to centre grid
set scale etc. In an editing mode I want to be able to draw a highlight line
from the centre of the grid to the mouse and at the mouse position display
radius and angle values. I am ok with the code to do this but when I run my
program I get a lot of flicker because my code clears the area and redraws
everything in the motion notify event handler. I really just want to clear
the line drawn to the mouse and then redraw it at the next position. My past
experience tells me that either, I want the grid to be on a base layer and
the hilight line on an upper layer, and then to just clear the upper layer.
Or Xor the previous line to restore the background before drawing the next
line. Trouble is I dont know if cairo will allow me to do either of these
options. Do I have to composite two surfaces instead? If so I havent a clue
on how to do this. Or should I save the grid as an image and then use that
as the background?

Could someone point me to an example or tutorial which would be of some
help.

Thanks
Alan
-- 
View this message in context: http://www.nabble.com/help-wanted-with-Cairo---fairly-inexperienced-user-tp26101739p26101739.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list