When rotating an image about its center (code below) the corers get cut off. It 
needs to just be a little wider and a little taller. Is there a calculation 
already in Qt?
How can I find the proper size that out should be, and where to place the image 
for drawImage within the new bounding box?

QImage rotate(const QImage &in, qreal degrees) {
        QImage out = QImage(in.size(), in.format());

        QPainter painter;
        painter.begin(&out);
        painter.translate(QPoint(out.width()/2, out.height()/2));
        painter.rotate(degrees);
        painter.translate(QPoint(-out.width()/2, -out.height()/2));
        painter.drawImage(0,0, in);
        painter.end();
        return out;
}
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to