mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-10 22:07:08 +01:00
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70205 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
15 lines
502 B
Python
15 lines
502 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)
|
|
|