So with this piece of code -
self.panel = wx.Panel(self, -1, pos=(150,80), size=(680,143))
self.images = DIter([filename for filename in os.listdir(IMAGE_DIR) if any(filename.lower().endswith(ext) for ext in (’.png’))])
img = wx.EmptyImage(680,143)
self.imageCtrl = wx.StaticBitmap(self.panel, wx.ID_ANY, wx.BitmapFromImage(img), pos=(0, 0))
def loadImage(self, event):
self.image_file = self.images.next()
print(self.image_file)
image_file = os.path.join(IMAGE_DIR, self.image_file)
img = wx.Image(image_file, wx.BITMAP_TYPE_ANY)
#img = img.Scale(680,143)
self.imageCtrl.SetBitmap(wx.BitmapFromImage(img))
I get a little black box where the panel is, and where the image loads -
Does anyone know what this could be? It might be the imageCtrl with the bitmap. But I am unsure.
When the image loads the black box is gone. It’s not a big problem really. Just a little annoying.
Thanks
Sion.