|
2009-11-29
, 13:38
|
|
Posts: 696 |
Thanked: 1,012 times |
Joined on Mar 2006
@ Asturies, Spain
|
#2
|
|
2009-11-29
, 14:01
|
Posts: 437 |
Thanked: 90 times |
Joined on Nov 2006
|
#3
|
pixbuf = gtk.gdk.pixbuf_new_from_file("image.png") pixmap,mask = pixbuf.render_pixmap_and_mask() cm = pixmap.get_colormap() red = cm.alloc_color('red') gc = pixmap.new_gc(foreground=red) pixmap.draw_rectangle(gc, False, x, y, w, h) image = gtk.Image() image.set_from_pixmap(pixmap, mask)
|
2009-11-29
, 18:14
|
|
Posts: 2,427 |
Thanked: 2,986 times |
Joined on Dec 2007
|
#4
|
aWindow = gtk.Window() ... myImage = gtk.Image() myImage.set_from_file('myFile.jpg') aWindow.add(myImage) cm = myImage.window.get_colormap() gc = myImage.window.new_gc(foreground=cm.alloc_color('#ff0000',True,False)) myImage.window.draw_rectangle(gc, False, x, y, width, height)
The Following User Says Thank You to daperl For This Useful Post: | ||
|
2009-11-29
, 19:03
|
Posts: 437 |
Thanked: 90 times |
Joined on Nov 2006
|
#5
|
I apologise for asking a basic question. Suppose I have the code:
and suppose I want to draw a rectangle (say) on top of the displayed PNG. How do I get round to doing this?
Thanks!