Hi,
For a program I've been making, I need to expand the a pixmap an
preserve it's contents, so I made this function:
def expandmap(pix, leftshift, rightshift, topshift, bottomshift):
oldimage=pix.get_image(0,0,width,height)
pix = gtk.gdk.Pixmap(window, width+leftshift+rightshift,
height+topshift+bottomshift)
pix.draw_image(gc, oldimage, 0,0,leftshift, topshift,width, height)
Which works nicely, except that it's much too slow when dealing with
the sort of pixmaps that my program is dealing with (2400x2400 with
the shifting values in the area of 16). I also tried changing it to this:
def expandmap(pix, leftshift, rightshift, topshift, bottomshift):
oldmap=pix
newpix = gtk.gdk.Pixmap(window, width+leftshift+rightshift,
height+topshift+bottomshift)
newpix.draw_drawable(gc, oldmap, 0,0,leftshift, topshift,width, height)
oldpix = None
pix = newpix
but it was not much better. It seems to be using lots of ram to do
this, and I'm thinking that perhaps it's not freeing the old pixmaps
properly. Does anybody have any
suggestions on a proformance friendly way to do this?
Alex Schultz
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/