I want to display a 139 cols * 121 rows image map.
(The image size is 32*32 px)
I use a gtk.Iconview
with a gtk.ListStore
that I fill with gtk.gdk.Pixbuf
, like this :
(the two dimensional graph
list contains objects that contain the images path to display)
pixbuf_passage = gtk.gdk.pixbuf_new_from_xpm_data(xpmdata)
for row in graph :
for col in row :
pixbuf = gtk.gdk.pixbuf_new_from_file(col.img_base)
if col.passage :
pixbuf_passage.composite(pixbuf, 0, 0, pixbuf_passage.props.width, pixbuf_passage.props.height, 0, 0, 1.0, 1.0, gtk.gdk.INTERP_BILINEAR, 255)
self.grid.listStore.append([pixbuf, tooltip])
My problem is that the image loading time can be quite long, depending on the computer's configuration :
- ~20s for a Intel Core i7 with 4Gb RAM (which is acceptable)
- ~160s for a AMD X2 4200+ with 4Gb RAM (which is too long)
Is there any way to speed up the image loading ? Perhaps the use of a gtk.Iconview isn't optimal here ?
Thanks