qt rotate qimage 1

qt rotate qimage

QImage* image = new QImage();
int angle = 45; //how much you want to rotate in degree
QImage rotated_image = image->transformed(QTransform().rotate(angle));

Here is what the above code is Doing:
1. Create a QImage object
2. Load the image from the path
3. Rotate the image by 45 degree
4. Save the rotated image

Similar Posts