QImage to QPixmap where should I add scale() If I want to set to QLable
Solved
Qt for Python
-
@darrenleeleelee1
Hi
hmm, I cant guess why.
for me, it clearly ignores the AspectRatio.Maybe your picture is perfectly square?
-
-
Hi
I tried with the same sizes as you, found image at (2235, 3408) alsoSo not why you always seems to see the same.
What Qt version are you using ?
-
Hi
Yes.{ qimage = qimage.scaled(ui->label->width(),ui->label->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation); auto pixmap = QPixmap::fromImage(qimage); ui->label->setPixmap(pixmap); }
-
Hi
as far as I know, nothing.
Both return a scaled copy.I cant see anything wrong with the code you shown. So unless its a bug in 5.9.7
i really have no idea why the images look the same to you.Also, you scale it down a lot so there should always be an effect.
-
ahh. Well that explains why they look so much the same :)
No worries, its no bother at all.