wxImage can't read tif file? (WxPython)

James Hu jhu at metrigenix.com
Fri Sep 2 10:35:01 EDT 2005


Hi, all gurus,

I am working on a small project, which needs to display 16 bit tiff image on
screen directly, I use wxStaticBitmap to do that, and I can show png and jpg
file on the screen without any problem. (converting from tiff to png first
is not option though). However, when I try to read tiff file, nothing
there,(the program is running without error) of course, the tiff is OK, I
can open it with IrFanView. where output.tif is about 640K, a little larger
than output.png(450K), the document says wxImage can open tif!
OR is there other way to show 16 bit tiff on windows with wxPython?
Another thing: how can I call the static methods like wxImage::FindHandler,
it always complains no matter what I use "image.FindHandler() or
wxImage.FindHandler()"

Any help will be apprecaited greatly!!!

James

the codes:

#image=wx.Image('output.png',wxBITMAP_TYPE_PNG)  #Can see,
image=wx.Image('output.tif',wxBITMAP_TYPE_TIF)   #can't see, still black as
the empty bitmap
bmp = image.ConvertToBitmap()
bmp.SetHeight(self.bmpHeight)
bmp.SetWidth(self.bmpWidth)
self.staticBitmap1.SetBitmap(bmp)   #staticBitmap1 already defined/created
before





More information about the Python-list mailing list