]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxStaticBitmap.py
New wxDesigner-less version of the MimeTypesManager demo
[wxWidgets.git] / wxPython / demo / wxStaticBitmap.py
1 # 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
2 #
3 # o Updated for wx namespace
4 #
5
6 import wx
7 import images
8
9 #----------------------------------------------------------------------
10
11 class TestPanel(wx.Panel):
12 def __init__(self, parent, log):
13 wx.Panel.__init__(self, parent, -1)
14 self.log = log
15 self.count = 0
16
17 wx.StaticText(self, -1, "This is a wxStaticBitmap.", (45, 15))
18
19 bmp = images.getTest2Bitmap()
20 mask = wx.MaskColour(bmp, wx.BLUE)
21 bmp.SetMask(mask)
22 wx.StaticBitmap(self, -1, bmp, (80, 50), (bmp.GetWidth(), bmp.GetHeight()))
23
24 bmp = images.getRobinBitmap()
25 wx.StaticBitmap(self, -1, bmp, (80, 150))
26
27 wx.StaticText(self, -1, "Hey, if Ousterhout can do it, so can I.", (200, 175))
28
29
30 #----------------------------------------------------------------------
31
32 def runTest(frame, nb, log):
33 win = TestPanel(nb, log)
34 return win
35
36 #----------------------------------------------------------------------
37
38 overview = """\
39 A static bitmap control displays a bitmap.
40
41 The bitmap to be displayed should have a small number of colours, such as 16,
42 to avoid palette problems.
43
44 A bitmap can be derived from most image formats using the wxImage class.
45
46 """
47
48 if __name__ == '__main__':
49 import sys,os
50 import run
51 run.main(['', os.path.basename(sys.argv[0])])