Oh my God. It hurts so much. Here it is:
w,h = pixbuf.get_width(), pixbuf.get_height()
drawable = gtk.gdk.Pixmap(None, w, h, 24)
gc = drawable.new_gc()
drawable.draw_pixbuf(gc, pixbuf, 0, 0, 0, 0, -1, -1)
gc.set_foreground(gtk.gdk.Color(65535, 0, 0))
drawable.draw_line(gc, 0, 0, w, h)
cmap = gtk.gdk.Colormap(gtk.gdk.visual_get_best(), False)
pixbuf.get_from_drawable(drawable, cmap, 0, 0, 0, 0, w, h)
He actually draws a black line ATM, not a red one, so I have some work to do ...
source
share