]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/StaticBitmap.py
   5 #---------------------------------------------------------------------- 
   7 class TestPanel(wx
.Panel
): 
   8     def __init__(self
, parent
, log
): 
   9         wx
.Panel
.__init
__(self
, parent
, -1) 
  13         wx
.StaticText(self
, -1, "This is a wx.StaticBitmap.", (45, 15)) 
  15         bmp 
= images
.getTest2Bitmap() 
  16         mask 
= wx
.MaskColour(bmp
, wx
.BLUE
) 
  18         wx
.StaticBitmap(self
, -1, bmp
, (80, 50), (bmp
.GetWidth(), bmp
.GetHeight())) 
  20         bmp 
= images
.getRobinBitmap() 
  21         wx
.StaticBitmap(self
, -1, bmp
, (80, 150)) 
  23         wx
.StaticText(self
, -1, "Hey, if Ousterhout can do it, so can I.", (200, 175)) 
  26 #---------------------------------------------------------------------- 
  28 def runTest(frame
, nb
, log
): 
  29     win 
= TestPanel(nb
, log
) 
  32 #---------------------------------------------------------------------- 
  35 A StaticBitmap control displays a bitmap. 
  37 The bitmap to be displayed should have a small number of colours, such as 16,  
  38 to avoid palette problems. 
  40 A bitmap can be derived from most image formats using the wx.Image class. 
  44 if __name__ 
== '__main__': 
  47     run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])