开发者

Add image dynamically to wx.StaticBitmap?

开发者 https://www.devze.com 2023-01-13 07:48 出处:网络
It is possible to add dynamically images to wx.StaticBitmap? Now I can only add one image and only change existing image.

It is possible to add dynamically images to wx.StaticBitmap?

Now I can only add one image and only change existing image.

I want to display next image after new line or something else.

My actual code:

self.images = wx.StaticBitmap(self, id=-1, pos=wx.DefaultPosition,
                            size=(-1,100),
                            style= wx.SUNKEN_BORDER)
data = open(imagename,"rb").read()
stream = cStringIO.StringIO(data)
image = wx.ImageFromStream(stream)
image.Rescale(77,57)
bmp = wx.BitmapFromImag开发者_运维问答e( image)
self.images.SetBitmap(bmp)


I don't see how you could possibly include more than one image in a wx.StaticBitmap.

However, you could:

  • dynamically create the image that you are going to display in the StaticBitmap, using PIL or something to "concatenate" the images
  • just display multiple wx.StaticBitmaps in a wx.Sizer of some kind
0

精彩评论

暂无评论...
验证码 换一张
取 消