mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-23 20:20:08 +01:00
15 lines
488 B
Python
15 lines
488 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.BitmapFromImage(image.Scale(32, 32))
|
|
|
|
# another possibility:
|
|
image.Rescale(32, 32)
|
|
bmp = wx.BitmapFromImage(image)
|
|
|