Rotation of a QImage by 90 degrees
Solved
General and Desktop
-
I have a QImage(32*128) as shown below.
I want to rotate it by 90 degrees which may look like this
Is there a simple function to rotate the QImage.
Also will the resolution change, when we rotate the image.
@Uday-More said in Rotation of a QImage by 90 degrees:
Is there a simple function to rotate the QImage.
I would say
QImage::transformed()
should do the job:QImage img("src.jpg"); QImage rotatedImg = img.transformed(QMatrix().rotate(90.0)); rotatedImg.save("rotated.jpg");
-
@KroMignon . Thanks
It works with transform function