PDA

View Full Version : QImage Format Issue



vishal.chauhan
8th March 2007, 07:49
Hi All,

I m using Qt 4.2.2 on my Intel Mac.

I m using QImage to load Image from the unsigned char array.
I m using the following line of code

image.loadFromData(qBuffer,SizeToRead);

It is working well in case of jpeg,Png,Bmp...

But when there is a Gif Image it is unable to create Image from the Array and I think it is because Qt does not support the Gif format Image.

So I want to ask whether it is possibe to change the format of the Gif image to PNG or some other format so that it show the Image.

If any body knows then plz Help me.

Thanks.

aamer4yu
8th March 2007, 09:31
Gif support is disabled by default in Qt.
To enable gif support, you have to compile Qt with gif option.

It can be done through configure.exe -qt-gif option while running the configure file in Qt.

Hope this helps :)

vishal.chauhan
8th March 2007, 12:19
Thanks for Reply.

But Actually I am using Qt 4.2.2 commercial Edition that is .dmg file to install qt.

I only run the setup and it installed that Qt.

I donot know how I add this code through Terminal.

wysota
8th March 2007, 12:23
If you have a commercial licence, then you can download Qt source code and recompile Qt to fit your needs (in this case passing -qt-gif to configure).

vishal.chauhan
8th March 2007, 12:32
Actually the Qt version I m downloading is the .dmg file and In it I m not getting that option.

wysota
8th March 2007, 14:00
Do you have a commercial licence?

vishal.chauhan
9th March 2007, 05:21
Yes,Actually I have Commercial License upto Feb last.

wysota
9th March 2007, 10:14
So go to Trolltech website, download Qt sources for MacOS (they have .tar.gz suffix) and rebuild Qt using the -qt-gif switch... I can't point you to an exact download location, as I don't have a commercial licence myself. If in doubt, please contact Trolltech support and ask them where to download from.