I do not know how to rotate bitmap BGR image of size 800 * 600 * 3 by 90 degrees. If it was an image with a header, the solution would be:
QPoint center
= srcImg.
rect().
center();
matrix.translate(center.x(), center.y());
matrix.rotate(90);
QImage dstImg
= srcImge.
transformed(matrix
);
QImage srcImg(":/icon.png");
QPoint center = srcImg.rect().center();
QMatrix matrix;
matrix.translate(center.x(), center.y());
matrix.rotate(90);
QImage dstImg = srcImge.transformed(matrix);
QPixmap dstPix = QPixmap::fromImage(dstImg);
To copy to clipboard, switch view to plain text mode
I read the whole image in a 800 * 600 * 3 image. Next, before I render it to the screen, I need to rotate it by 90 degrees.
Bookmarks