There is lots of advice on the internet about this, and most of it amounts to “roll your own,” using a variety of techniques. I can’t tell which technique is best.
I can make some accommodations for a technique which will get me faster speed. Like, I can use a wx.Bitmap for the input instead of wx.Image. Or I can draw directly to a DC, as long as that DC allows me to use wx.GraphicsContext with alpha blending.
I do need the features of wx.StaticBitmap, in particular I need to change the image size sometimes. My wx.StaticBitmap is inside of a wx.ScrolledPanel so the wx.ScrolledPanel needs to know the size of the image.
What is the state of the art for a fast wx.StaticBitmap?
If you have rapidly changing big images, it is better to write your own control with double-buffered DC.
A year ago I posted a benchmark of drawing speed for some packages including wxStaticBitmap.
(Actually, there was no difference in speed between wxStaticBitmap, DC, and double-buffered DC, but only flickering or not):
So I’ve improved my program’s rendering performance, and here’s how:
Use GenStaticBitmap instead of StaticBitmap. This eliminates the flickering.
Draw with a gc = wx.GraphicsContext.Create(wx.MemoryDC(bitmap)). This allows me to draw with GraphicsContext commands directly into the wx.Bitmap with no copies. Then I can SetBitmap(bitmap) the GenStaticBitmap.