QImage aImage
("aImg.png");
// say size = 40x40 QImage bImage
("bImg.png");
// say size = 70x40
QImage aImage("aImg.png"); // say size = 40x40
QImage bImage("bImg.png"); // say size = 70x40
To copy to clipboard, switch view to plain text mode
To mosaick:
1. Create an image with the appropriate size.
QImage cImage
(110,
40,
QImage::Format_RGB32);
// say size = 40x40
QImage cImage(110, 40, QImage::Format_RGB32); // say size = 40x40
To copy to clipboard, switch view to plain text mode
2. Read pixel data from aImage and bImage and store it in appropriate positions in cImage. This can be done by scanning line by line using QImage::scanLine().
Example, to copy 0th pixel of a specific row from bImage to cImage:
QRgb* bImgLine = (QRgb*)bImage.scanLine(row);
QRgb* cImgLine = (QRgb*)cImage.scanLine(row);
*(cImgLine+40) = *(bImgLine+0);
QRgb* bImgLine = (QRgb*)bImage.scanLine(row);
QRgb* cImgLine = (QRgb*)cImage.scanLine(row);
*(cImgLine+40) = *(bImgLine+0);
To copy to clipboard, switch view to plain text mode
Bookmarks