Skip to content Skip to sidebar Skip to footer

In Pygtk, What Is A Simple Way To Show A Png File?

The following PyGTK code displays a PNG file in a window. Is there a simpler or better way of displaying the PNG file, like, by using a gtk.DrawingArea? For example, how do you res

Solution 1:

You should call directly image.set_from_file instead of creating a pixbuf and a pixmap. As to handle resizing, I did it once by using directly a gtk.DrawingArea, using the configure signal to get the height and width of the drawing area, and the expose-event event to paint it with cairo on the whole surface. But there may be a way of using a gtk.Image too.


Post a Comment for "In Pygtk, What Is A Simple Way To Show A Png File?"