How to get the bitmap from an Qimage
-
Hi guys,
I need to have the array with the bits from a QImage. I thougth I could do something with the
@
QImage myImage;
myImage.load("clouds.jpg");
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
myImage.save(&buffer, "PNG"); // writes image into ba in PNG format@I need that array because then I can have a second array from an image to transform the 2 images and show them back on the screen.
For example got a background image + a foreground image and then I could merge them that you see the background image only where the foreground image has nothing to show.
Kind regards,
-
Hi,
If I understand you right, you want to composite images. You can use "QPainter::setCompositionMode":http://developer.qt.nokia.com/doc/qt-4.8/qpainter.html#setCompositionMode