compose a second patch

This commit is contained in:
Jon Dowland 2008-02-23 12:27:01 +00:00
parent 724d8b7056
commit 0291253742

View file

@ -42,6 +42,27 @@ class ImagesExample:
gtk.gdk.INTERP_NEAREST gtk.gdk.INTERP_NEAREST
)) ))
image.show() image.show()
image2 = gtk.Image()
image2.set_from_file("../../patches/wall42_3.gif")
pb = image2.get_pixbuf()
image2.set_from_pixbuf(pb.scale_simple(
pb.get_width() * scale,
pb.get_height() * scale,
gtk.gdk.INTERP_NEAREST
))
pb = image2.get_pixbuf()
pb.composite(
image.get_pixbuf(),
0, 0,
pb.get_width(), pb.get_height(),
0, 0, # offsets
1, 1, # scale
gtk.gdk.INTERP_NEAREST, 255
)
# a button to contain the image widget # a button to contain the image widget
button = gtk.Button() button = gtk.Button()
button.add(image) button.add(image)