Question

I would to have a QPixmap with the size 50 x 50. I tried :

QPixmap watermark(QSize(50,50)); 
watermark.load(":/icoMenu/preparation");

but the QPixmap take the image size.

I tried also :

QPixmap watermark(":/icoMenu/preparation");
watermark.scaled(QSize(50,50),  Qt::KeepAspectRatio);

but same result.

Was it helpful?

Solution

You almost made it

QPixmap watermark(":/icoMenu/preparation");

QPixmap newPixmap = watermark.scaled(QSize(50,50),  Qt::KeepAspectRatio);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top