Results 1 to 7 of 7

Thread: Why does this QPixmap::fromImage() crash?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2008
    Posts
    53
    Thanks
    10

    Default Re: Why does this QPixmap::fromImage() crash?

    The problem was that I didn't have a colormap, which was the array that it was trying to index.

    Apparently when I try to use fromImage: "..the image is first converted to a 32-bit pixmap and then filled with the colors in the color table." (Qt documentation)

    Which is kind of weird that I need to initialize a color table even though i'm using QImage::Format_Indexed8

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

    Default Re: Why does this QPixmap::fromImage() crash?

    What do you mean by "even though"? If you are using an indexed format then do you need a colour table. It won't get initialized on its own...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Crash: Heap corruption due to selectedRows()
    By Ankitha Varsha in forum Qt Programming
    Replies: 16
    Last Post: 1st October 2010, 00:55
  2. Replies: 28
    Last Post: 9th March 2010, 08:59
  3. QString comparison gives wierd crash
    By supergillis in forum Qt Programming
    Replies: 0
    Last Post: 1st June 2009, 22:09
  4. Replies: 2
    Last Post: 13th August 2008, 17:46
  5. QTimer ->start(0) + OpenGL + resize/move window => crash
    By anthibug in forum Qt Programming
    Replies: 5
    Last Post: 8th July 2008, 11: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
  •  
Qt is a trademark of The Qt Company.