Qt 6.11 is out! See what's new in the release
blog
QLabel -> QPixmap -> get real image position?!
General and Desktop
2
Posts
2
Posters
3.1k
Views
2
Watching
-
Hi Guys,
I need to get the scaled image position and size of a QPixmap drawn on to a QLabel. How can I achieve this? Unfortunately I only found out how to get the label or image size (before scaling).
Code snippet from label class:
QLabel::setPixmap(pix.scaled(this->size(), Qt::KeepAspectRatio, Qt::FastTransformation);Code snippet from main class:
ui->imageViewerLabel->imagePixmap...???Best regards,
Eddi0406 -
Hi,
Are you looking for the QLabel::pixmap() function ?