Results 1 to 8 of 8

Thread: QImage Format Issue

  1. #1
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question QImage Format Issue

    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.
    Last edited by vishal.chauhan; 8th March 2007 at 09:00.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QImage Format Issue

    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

  3. #3
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Re: QImage Format Issue

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QImage Format Issue

    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).

  5. #5
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Re: QImage Format Issue

    Actually the Qt version I m downloading is the .dmg file and In it I m not getting that option.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QImage Format Issue

    Do you have a commercial licence?

  7. #7
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Re: QImage Format Issue

    Yes,Actually I have Commercial License upto Feb last.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QImage Format Issue

    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.

Similar Threads

  1. how i can add image in my toolbar
    By jyoti in forum Qt Tools
    Replies: 7
    Last Post: 19th December 2006, 14:39
  2. "sensitising" an image
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 28th June 2006, 07:21
  3. Fast image drawing/scaling in Qt 3.3
    By eriwik in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 10:45
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 19:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.