Files
Phoenix/docs/sphinx/rest_substitutions/snippets/python/converted/Image.Scale.1.py
2011-12-30 19:17:09 +00:00

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)