def GetBitmap(self, use_theme=True, resize=None): image = PEI.GetImage(self) if DARKMODE and use_theme: image.Replace(0, 0, 0, icon_r, icon_g, icon_b) if resize is not None: image = image.Scale(*resize) return wx.Bitmap(image)
self.sizer=wx.FlexGridSizer(1,1,0,0) self.sizer.AddGrowableCol(0) self.sizer.AddGrowableRow(0) self.sizer.Add(self.panel,1,wx.ALIGN_CENTER,0) self.SetSizer(self.sizer) self.showimage(title) self.panel.Bind(wx.EVT_KEY_DOWN,self.keydown) self.panel.Bind(wx.EVT_CHAR,self.keychar) self.panel.Bind(wx.EVT_MOTION,self.drag) self.panel.Bind(wx.EVT_MOUSE_EVENTS,self.drag) self.bitmap.Bind(wx.EVT_MOTION,self.drag) self.bitmap.Bind(wx.EVT_MOUSE_EVENTS,self.drag) self.Bind(wx.EVT_SIZE,self.fresize) if osflag: self._icon=bpglogo.GetIcon() else: tmp_icon=bpglogo.GetImage() tmp_icon.Rescale(32,32,wx.IMAGE_QUALITY_HIGH) self._icon=wx.EmptyIcon() self._icon.CopyFromBitmap(wx.BitmapFromImage(tmp_icon)) try: self.SetIcon(self._icon) except: pass self.Layout() self.Center() self.panel.SetFocus() def loadindex(self,old): if self.index!=old: self.stitle(_('Loading...')) self.showimage(self.filelist[self.index]) def previous(self):