Although I am not that familiar with Qt, I think there is a function for scaling images in labels.
QImage image
(filePath
);
//Have a QImage read in the image from a certain file
ui->labelForImage->setScaledContents(false); //Make the label not scale the picture
ui->labelForImage->setAlignment( Qt::AlignCenter ); //Alignthe picture in the middle of the label
ui
->labelForImage
->setPixmap
(QPixmap::fromImage(image
));
//Put the picture into the label
QImage image(filePath); //Have a QImage read in the image from a certain file
ui->labelForImage->setScaledContents(false); //Make the label not scale the picture
ui->labelForImage->setAlignment( Qt::AlignCenter ); //Alignthe picture in the middle of the label
ui->labelForImage->setPixmap(QPixmap::fromImage(image)); //Put the picture into the label
To copy to clipboard, switch view to plain text mode
The one issue I can think of for this is that if the picture is larger than the label, the label will expand. I am not sure how to get around this though.
Anyway, I hope this helps. Cheers.
Bookmarks