]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/StaticBitmap.py
   9     from wx
.lib
.stattext 
import GenStaticText 
as StaticText
 
  10     from wx
.lib
.statbmp  
import GenStaticBitmap 
as StaticBitmap
 
  12     StaticText 
= wx
.StaticText
 
  13     StaticBitmap 
= wx
.StaticBitmap
 
  16 #---------------------------------------------------------------------- 
  18 class TestPanel(wx
.Panel
): 
  19     def __init__(self
, parent
, log
): 
  20         wx
.Panel
.__init
__(self
, parent
, -1) 
  22         ##self.SetBackgroundColour("sky blue") 
  24         StaticText(self
, -1, "This is a wx.StaticBitmap.", (45, 15)) 
  26         bmp 
= images
.getTest2Bitmap() 
  27         mask 
= wx
.Mask(bmp
, wx
.BLUE
) 
  29         StaticBitmap(self
, -1, bmp
, (80, 50), (bmp
.GetWidth(), bmp
.GetHeight())) 
  31         bmp 
= images
.getRobinBitmap() 
  32         StaticBitmap(self
, -1, bmp
, (80, 150)) 
  34         StaticText(self
, -1, "Hey, if Ousterhout can do it, so can I.", (200, 175)) 
  37 #---------------------------------------------------------------------- 
  39 def runTest(frame
, nb
, log
): 
  40     win 
= TestPanel(nb
, log
) 
  43 #---------------------------------------------------------------------- 
  46 A StaticBitmap control displays a bitmap. 
  48 A bitmap can be derived from most image formats using the wx.Image class. 
  52 if __name__ 
== '__main__': 
  55     run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])