]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/StaticBitmap.py
Namechange changes
[wxWidgets.git] / wxPython / demo / StaticBitmap.py
CommitLineData
cf694132 1
8fa876ca
RD
2import wx
3import images
cf694132
RD
4
5#----------------------------------------------------------------------
6
8fa876ca 7class TestPanel(wx.Panel):
cf694132 8 def __init__(self, parent, log):
8fa876ca 9 wx.Panel.__init__(self, parent, -1)
cf694132
RD
10 self.log = log
11 self.count = 0
12
95bfd958 13 wx.StaticText(self, -1, "This is a wx.StaticBitmap.", (45, 15))
cf694132 14
96bfd053 15 bmp = images.getTest2Bitmap()
8fa876ca 16 mask = wx.MaskColour(bmp, wx.BLUE)
1b62f00d 17 bmp.SetMask(mask)
8fa876ca 18 wx.StaticBitmap(self, -1, bmp, (80, 50), (bmp.GetWidth(), bmp.GetHeight()))
cf694132 19
afb810d9 20 bmp = images.getRobinBitmap()
8fa876ca 21 wx.StaticBitmap(self, -1, bmp, (80, 150))
cf694132 22
8fa876ca 23 wx.StaticText(self, -1, "Hey, if Ousterhout can do it, so can I.", (200, 175))
cf694132
RD
24
25
26#----------------------------------------------------------------------
27
28def runTest(frame, nb, log):
29 win = TestPanel(nb, log)
30 return win
31
32#----------------------------------------------------------------------
33
8fa876ca 34overview = """\
95bfd958 35A StaticBitmap control displays a bitmap.
cf694132 36
8fa876ca
RD
37The bitmap to be displayed should have a small number of colours, such as 16,
38to avoid palette problems.
cf694132 39
95bfd958 40A bitmap can be derived from most image formats using the wx.Image class.
cf694132 41
1fded56b 42"""
cf694132 43
1fded56b
RD
44if __name__ == '__main__':
45 import sys,os
46 import run
47 run.main(['', os.path.basename(sys.argv[0])])