[cairo] Drawing a transparent rectangle on an Image
sk8in_zombi at yahoo.com.au
Tue Jul 15 07:37:40 PDT 2008
I am drawing a semi transparent dotted rectangle on an image .What I want to do is to change the border ticks to alternate so they appear as if the ticks are moving around the rectangle.Here is the code that I wrote to draw the rectangle as such with hard coded co-ord for now :
def expose_event(widget, event, surface):
ctx = widget.window.cairo_create()
ctx.set_source_rgba(1, 1, 1,0.5)
ctx.set_line_width(20 / 16)
ctx.set_dash([20/2.0, 20/2.0], 8)
ctx.set_source_rgba(0,0 ,0 ,0.5)
Now I can change the ticks by changing the set_dash args but I don't want to put it in an infinite while loop.Also,I don't want it to be CPU intensive.
" life isn't heavy enough,it flies away and floats far above action"
Start at the new Yahoo!7 for a better online experience. www.yahoo7.com.au
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo