Results 1 to 4 of 4

Thread: QImage Restricted to 256 Pixels?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    28
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QImage Restricted to 256 Pixels?

    Hey,

    I was just wondering about QImage if its only restricted to 256 pixels to be displayed and if there was another format I could use to correct QImage or another class similar to QImage I can use to create images through pixels.

    The following is the coding I used:
    Qt Code:
    1. QImage image (13,20, QImage::Format_Indexed8);
    2. QRgb value;
    3. value = qRgb (240,240,240);
    4. image.setColor (256, value);
    To copy to clipboard, switch view to plain text mode 

    The following error is what I receive when I attempt to assign 260 Pixels:

    QImage::setColor: Index out of bound 256
    QImage::setColor: Index out of bound 257
    QImage::setColor: Index out of bound 258
    QImage::setColor: Index out of bound 259
    QImage::setPixel: Index 257 out of range
    QImage::setPixel: Index 258 out of range
    QImage::setPixel: Index 259 out of range

    Thanks,
    Strateng
    Last edited by strateng; 1st April 2010 at 01:05.

Similar Threads

  1. Replies: 16
    Last Post: 29th March 2010, 07:05
  2. best way of reading and writing QImage pixels?
    By billconan in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2010, 08:23
  3. Pixels
    By Dante in forum Qt Programming
    Replies: 1
    Last Post: 21st April 2009, 20:50
  4. How to change the values of the pixels in an Qimage?
    By kid17 in forum Qt Programming
    Replies: 8
    Last Post: 23rd November 2008, 20:52
  5. Convert RAW 8 bit pixels into a QImage
    By danielperaza in forum Qt Programming
    Replies: 3
    Last Post: 10th March 2008, 14:53

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.