]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-12/images.py
   3 filenames 
= ["image.bmp", "image.gif", "image.jpg", "image.png" ] 
   5 class TestFrame(wx
.Frame
): 
   7         wx
.Frame
.__init
__(self
, None, title
="Loading Images") 
  10         fgs 
= wx
.FlexGridSizer(cols
=2, hgap
=10, vgap
=10) 
  11         for name 
in filenames
: 
  12             # load the image from the file 
  13             img1 
= wx
.Image(name
, wx
.BITMAP_TYPE_ANY
) 
  15             # Scale the original to another wx.Image 
  18             img2 
= img1
.Scale(w
/2, h
/2) 
  20             # turn them into static bitmap widgets 
  21             sb1 
= wx
.StaticBitmap(p
, -1, wx
.BitmapFromImage(img1
)) 
  22             sb2 
= wx
.StaticBitmap(p
, -1, wx
.BitmapFromImage(img2
)) 
  24             # and put them into the sizer 
  32 app 
= wx
.PySimpleApp()