Search code examples
wxwidgetswxpython

Problem using wx.StaticBitmap.SetScaleMode()


I am trying to resize a static bitmap whilst maintaining its aspect ratio. According to the docs, it looks like wx.StaticBitmap.SetScaleMode(Scale_AspectFit) should do the trick.

What do I need to import to make the ScaleMode enumeration (and Scale_AspectFit) available?


Solution

  • As far as I can tell, as of May 2020 (wxPython 4.1.0), it is not currently supported, although it is mentioned in the documentation.
    I'd hazard a guess that if it is implementated, it will simply be MyStaticBitMap.SetScaleMode(int)

    See: https://discuss.wxpython.org/t/setscalemode-and-genericstaticbitmap/34400