wxImage problem

Jeff Shannon jeff at ccvcorp.com
Fri Apr 12 15:15:35 EDT 2002


In article <d5534716.0204121048.3a666b3c at posting.google.com>, 
eddieborder2001 at yahoo.co.uk says...
> how can i put an image into a wxPanel?
> i read on the net that the code is ...
> 
> wxImage_AddHandler(wxGIFHandler())
> gif = wxImage('bitmaps/image.gif', wxBITMAP_TYPE_GIF).ConvertToBitmap()
> wxStaticBitmap(panel, -1, bmp, wxPoint(10, pos),wxSize(bmp.GetWidth
> (),bmp.GetHeight()))

Here, you're loading the image and converting it to a wxBitmap, 
and assigning that bitmap to 'gif'.  Then you're creating a  
wxStaticBitmap, and passing it an identifier 'bmp' -- perhaps 
this is your problem?  

Other than that, and that I believe it's considered somewhat 
preferable to use 'wxBitmapFromImage( wxImage(...) )' rather than 
'wxImage(...).ConvertToBitmap()' as you do here, this looks right 
at first glance, but I haven't tested or compared with the 
docs...

If you're having any other problems, it's very helpful if you 
post the complete error messages that you're getting, or a 
specific description of the problematic behavior, so that we're 
not left trying to second-guess the issue...  

-- 

Jeff Shannon
Technician/Programmer
Credit International



More information about the Python-list mailing list