Hello,
I'm trying to embed a chartdrawer library that can only give me a bmp image in a buffer.
I'm loading this image and have to explicitly call delete on the newly created pixbuf and then call the garbage collector.
The drawing method is called each 50ms
calling the garbage collector is realy CPU consuming.
Is there a way to have only one pixbuf for the all process and thus not have to call gc?
Or am I doing everything wrong?
Thx in advance for any help
Raphaël
code:
def draw(self, drawArea):
#init bmp loader
loader = gtk.gdk.PixbufLoader ('bmp')
#get a bmp buffer
chart = drawArea.outBMP2()
#load this buffer
loader.write(chart)
loader.close()
#get the newly created pixbuf
pixbuf = loader.get_pixbuf()
#and load it in the gtk.Image
self.img.set_from_pixbuf(pixbuf)
del pixbuf
gc.collect()