Dear Slawomir,
In line 38 use
bmp = wx.BitmapFromImage(img)
In Python functions cannot be owerwritten, and you used the constructor
which accepts only the filename to create the bitmap. Please refer to the
docs again.
Regards
Oliver
···
-----Ursprüngliche Nachricht-----
Von: news [mailto:news@sea.gmane.org] Im Auftrag von Alex Zeiger
Gesendet: Dienstag, 8. Juni 2004 08:24
An: wxpython-users@lists.wxwindows.org
Betreff: [wxPython-users] Re: Resize Bitmap?
Slawomir Nowaczyk wrote:
On Sun, 06 Jun 2004 18:00:16 -0400 > Alex Zeiger <zeiger@nospam.snowbird.net> wrote:
#> What's the easiest way to resize a bitmap? Wx doesn't seem to have
#> any applicable function. Any help is appreciated.I don't know if there exists an easier way, but you can convert Bitmap
to Image and then use Rescale() method.HTH
Interesting. I tried that, but when I tried converting the image back to
a bitmap, I recieved the error:
File "canvas.py", line 38, in __init__
bmp = wx.Bitmap(img)
File "C:\Python23\Lib\site-packages\wx\gdi.py", line 454, in __init__
newobj = _gdi.new_Bitmap(*args, **kwargs)
TypeError: String or Unicode type required
Where bmp and img are defined as:
bmp = wx.Bitmap('image.png',wx.BITMAP_TYPE_PNG)
img = bmp.ConvertToImage()
Am I using the wxBitmap constructor correctly? Any help is appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org