Confused Newbie - wxImage vs WxImage pointer

Knoppix User knoppix at laptop.home.net
Mon Dec 29 00:09:00 EST 2003


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