Hello,
attached scrip produces this output on WinXP/SP2:
__WXMSW__ (2, 8, 7, 1, '') 1 (2, 4, 4, 'final', 0)
False
True
False
True
returned images for inplace methods are not valid.
Niki Spahiev
wx_rescale.py (860 Bytes)
Hello,
attached scrip produces this output on WinXP/SP2:
__WXMSW__ (2, 8, 7, 1, '') 1 (2, 4, 4, 'final', 0)
False
True
False
True
returned images for inplace methods are not valid.
Niki Spahiev
wx_rescale.py (860 Bytes)
returned images for inplace methods are not valid.
They are valid if you do this:
b1 = wx.BitmapFromXPMData(xpm).ConvertToImage()
b1_s = b1.Rescale(*sz)
Both b1 and b1_s point to the same valid scaled image.
So I guess you mush keep a reference to an image before scaling it.
The following code will crash on the third print:
b1 = wx.BitmapFromXPMData(xpm).ConvertToImage()
b1_s = b1.Rescale(*sz)
b2 = wx.BitmapFromXPMData(xpm).ConvertToImage().Rescale(*sz)
print b1.IsOk()
print b1_s.IsOk()
print b2.IsOk()