mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-13 07:17:08 +01:00
⁉️ Not sure if the generated .rst stuff is intended to have
whitespace like this in it or not, so seperating this from the other
commits, so easy to revert if necessary.
15 lines
434 B
Python
15 lines
434 B
Python
|
|
# get the bitmap from somewhere
|
|
bmp = wx.Bitmap('my_png.png', wx.BITMAP_TYPE_PNG)
|
|
|
|
# rescale it to have size of 32*32
|
|
if bmp.GetWidth() != 32 or bmp.GetHeight() != 32:
|
|
|
|
image = bmp.ConvertToImage()
|
|
bmp = wx.Bitmap(image.Scale(32, 32))
|
|
|
|
# another possibility:
|
|
image.Rescale(32, 32)
|
|
bmp = wx.Bitmap(image)
|
|
|