Qt-interest Archive, March 2002
QImage and QColor
Message 1 in thread
Can QColor::pixel() be used as the pixel value for QImage::fill()
and get the correct color? The following are examples of what I am
trying to do and what works. This is using Qt 2.3.2 on a Linux
system.
The following does not yield an image with the "correct" color:
QImage image;
QColor bg("red");
image.create(640, 480, 32);
image.fill(bg.pixel());
The following does yield an image with the "correct" color:
QImage image;
QColor bg("red");
image.create(640, 480, 32);
image.fill((bg.red() << 16) | (bg.green() << 8) | bg.blue());
Thanks.
---
Kent Vander Velden
kent@iastate.edu