Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt QPixmap size

Tags:

qt

qpixmap

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.

like image 604
artoon Avatar asked Feb 16 '23 17:02

artoon


1 Answers

You almost made it

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

QPixmap newPixmap = watermark.scaled(QSize(50,50),  Qt::KeepAspectRatio);
like image 50
evilruff Avatar answered Feb 28 '23 12:02

evilruff