Python Forum
[WxPython] wx.StaticBitmap change image
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[WxPython] wx.StaticBitmap change image
#1
Hi,when I created a StaticBitmap, and a combobox. I had the idea that, as I would to change the image in StaticBitmap, from another event.
From combobox.

my code of StaticBitmap
self.m_bitmap1 = wx.StaticBitmap(self, wx.ID_LOGO, wx.Bitmap(u"example.png", wx.BITMAP_TYPE_ANY),
                                         wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_bitmap1.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVEBORDER))
        self.m_bitmap1.SetToolTip(u"logo of example")
        bSizer6.Add(self.m_bitmap1, 0, wx.ALIGN_CENTER | wx.ALL, 5)
event of combobox
    def option_combo(self, event):
        selection = self.comboBox_Dir.GetSelection()
        if selection == 0:
            pass      # change image in StaticBitmap


        #print(selection)
        #event.Skip()
Reply


Messages In This Thread
wx.StaticBitmap change image - by royer14 - Jul-01-2018, 05:37 PM
RE: wx.StaticBitmap change image - by Barrowman - Jul-01-2018, 09:57 PM
RE: wx.StaticBitmap change image - by royer14 - Jul-01-2018, 11:27 PM
RE: wx.StaticBitmap change image - by Barrowman - Jul-02-2018, 05:49 AM
RE: wx.StaticBitmap change image - by royer14 - Jul-02-2018, 02:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Tkinter don't change the image DQT 2 1,698 Jul-22-2022, 10:26 AM
Last Post: menator01
  [Tkinter] How do I change an image dynamically LeeMadeux 7 32,423 Jun-04-2020, 10:00 PM
Last Post: deanhystad
  [WxPython] StaticBitmap: unexpected behaviour giu88 0 2,102 Oct-06-2018, 10:09 AM
Last Post: giu88

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020