[ILUG-BOM] Tiff image support in QT
Mon Dec 17 15:42:22 IST 2001
I am loading an image using QPixmap and successfully displaying the
image in the client area of the application.
But when I am working with TIF image, it is unable to load it in the
QPixmap, TIFF format is not in the supported format list of QT, So when
I searched, I got the following TWO options to support TIFF format in
First is QImageFormat's decoding procedure to install the new format.
where you have to override DecoderFor, FormatName and Decode. Which I
was unable to do, So any help in this case would be really appreciated.
Secondly, I got the following code for defining the new format support.
Which is crashing after the last line of the code.
My code goes this way
QImageIO::defineIOHandler( "TIF", // format name
"\\x49\\x49\\x2A\\x01", // header-regexp
write_tif_image ); //
myImageIO = new QImageIO( strFileName,"TIFF"/"TIF"); //tried with TIFF
QIODevice *d = myImageIO->ioDevice();
QDataStream s( d );
const buflen = 24;
d->readBlock( buf, 4 ); // read signature
Waiting for an early reply...
More information about the Linuxers