Confused Newbie - wxImage vs WxImage pointer
Tom
twa at post.com
Mon Dec 29 07:31:42 EST 2003
wxPython is a wrapper around wxWindows. The wxBitmapPtr is a handle to
the C++ object that is the actual object holding the bitmap.
Badly explained but that's basically it (For wxPython questions you
should try the wxPython mailing list).
Tom
Knoppix User wrote:
> Hi there,
>
> I am just starting up with Python, and loving it.
>
> This snippet has me consomethingbobulated:
>
>
> ..................
> jpgName = "/home/knoppix/Photos/Play/mvc00022.jpg"
> img = wxImage(jpgName, wxBITMAP_TYPE_JPEG).ConvertToBitmap()
> imgSmall = img.scale(100,100)
> wxStaticBitmap(self, -1, imgSmall, pos = (120, 20), size= (100,100))
> ...................
>
>
> I get this error:
>
> Traceback (most recent call last):
> File "GalleryTextProvider.py", line 152, in ?
> app = MyApp(0)
> File "/usr/lib/python2.3/site-packages/wxPython/wx.py", line 1951, in __init__
> _wxStart(self.OnInit)
> File "GalleryTextProvider.py", line 147, in OnInit
> frame = MyFrame(NULL, -1, "GalleryTextProvider")
> File "GalleryTextProvider.py", line 100, in __init__
> imgSmall = img.scale(100,100)
> AttributeError: wxBitmapPtr instance has no attribute 'scale'
>
> If img is of type wxImage, how can it be pointer, and not a bitmap.
>
> Any smacks to the head appreciated ( as long as they point me in the right
> direction!
>
> Steve
>
More information about the Python-list
mailing list