scale up image

This commit is contained in:
Jon Dowland 2008-02-23 12:23:15 +00:00
parent 0acfa03e75
commit 724d8b7056

View file

@ -33,6 +33,14 @@ class ImagesExample:
# buttons # buttons
image = gtk.Image() image = gtk.Image()
image.set_from_file("../../patches/wall40_1.gif") image.set_from_file("../../patches/wall40_1.gif")
pixbuf = image.get_pixbuf()
if pixbuf:
scale = 2
image.set_from_pixbuf(pixbuf.scale_simple(
pixbuf.get_width() * scale,
pixbuf.get_height() * scale,
gtk.gdk.INTERP_NEAREST
))
image.show() image.show()
# a button to contain the image widget # a button to contain the image widget
button = gtk.Button() button = gtk.Button()