[solved] QPainter:: drawImage resize
-
Can I resize the image before drawing?
QImage img1;
img1.load(filename);
img1.scaled(width1, height1).scaled(width1, height1, Qt::IgnoreAspectRatio,Qt::SmoothTransformation);
draw.drawImage(250,80, img1);It does not work.
=====================
solved by myself.
QPainter::scale() -
Hi,
scaled returns a new QImage so it should be:
@QImage img2 = img1.scaled(width1, height1);
draw.drawImage(250, 80, img2);@