]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxStaticBitmap.py
1 # 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
3 # o Updated for wx namespace
9 #----------------------------------------------------------------------
11 class TestPanel(wx
.Panel
):
12 def __init__(self
, parent
, log
):
13 wx
.Panel
.__init
__(self
, parent
, -1)
17 wx
.StaticText(self
, -1, "This is a wxStaticBitmap.", (45, 15))
19 bmp
= images
.getTest2Bitmap()
20 mask
= wx
.MaskColour(bmp
, wx
.BLUE
)
22 wx
.StaticBitmap(self
, -1, bmp
, (80, 50), (bmp
.GetWidth(), bmp
.GetHeight()))
24 bmp
= images
.getRobinBitmap()
25 wx
.StaticBitmap(self
, -1, bmp
, (80, 150))
27 wx
.StaticText(self
, -1, "Hey, if Ousterhout can do it, so can I.", (200, 175))
30 #----------------------------------------------------------------------
32 def runTest(frame
, nb
, log
):
33 win
= TestPanel(nb
, log
)
36 #----------------------------------------------------------------------
39 A static bitmap control displays a bitmap.
41 The bitmap to be displayed should have a small number of colours, such as 16,
42 to avoid palette problems.
44 A bitmap can be derived from most image formats using the wxImage class.
48 if __name__
== '__main__':
51 run
.main(['', os
.path
.basename(sys
.argv
[0])])