try this
painter.begin(&picture); // paint in picture
painter.drawEllipse(0,0, 80,70); // draw an ellipse
painter.end(); // painting done
picture.save("drawing.pic");
picture.load("drawing.pic");
QPixmap pixmap
(picture.
boundingRect().
size());
painter.begin(&pixmap);
painter.drawPicture(0, 0, picture);
painter.end();
pixmap.save("drawing_not_scaled.png", "PNG");
pixmap = pixmap.scaled(200, 200);
pixmap.save("drawing_scaled.png", "PNG");
QPicture picture;
QPainter painter;
painter.begin(&picture); // paint in picture
painter.drawEllipse(0,0, 80,70); // draw an ellipse
painter.end(); // painting done
picture.save("drawing.pic");
picture.load("drawing.pic");
QPixmap pixmap(picture.boundingRect().size());
painter.begin(&pixmap);
painter.drawPicture(0, 0, picture);
painter.end();
pixmap.save("drawing_not_scaled.png", "PNG");
pixmap = pixmap.scaled(200, 200);
pixmap.save("drawing_scaled.png", "PNG");
To copy to clipboard, switch view to plain text mode
Bookmarks