Hello,
below is an untested code snippet. I did something like this with QPixmap. As both QImage and QPixmap are paint devices, it should work with QImage too. Idea:
Create an image of the desired result size and draw your two images using a painter into the result image. See the documentation of QPainter::drawImage() to find the method that best fits your needs.
QImage image1
= ...;
// your images QImage result
(resultWidth, resultHeight, resultFormat
);
// image to hold the join of image 1 & 2 painter.drawImage(x1, y1, image1); // xi, yi is the position for imagei
painter.drawImage(x2, y2, image2);
QImage image1 = ...; // your images
QImage image2 = ...;
QImage result(resultWidth, resultHeight, resultFormat); // image to hold the join of image 1 & 2
QPainter painter(&result);
painter.drawImage(x1, y1, image1); // xi, yi is the position for imagei
painter.drawImage(x2, y2, image2);
To copy to clipboard, switch view to plain text mode
Best regards
ars
Bookmarks