when the image is loaded in the frame, I need to resize frame to fit image size. Otherwise image margins may get out of frame border.
can I resize the whole image generally to fit exactly inside a frame of any size ? the image is png
when the image is loaded in the frame, I need to resize frame to fit image size. Otherwise image margins may get out of frame border.
can I resize the whole image generally to fit exactly inside a frame of any size ? the image is png
I used scaled() to resize the image, but it has no effect!
Qt Code:
QImage myImage; myImage.load("path-to-png"); myImage.scaled(ui->frame->width(), ui->frame->height(), Qt::IgnoreAspectRatio );To copy to clipboard, switch view to plain text mode
is there anything wrong with the code?
Hi,
Yes.is there anything wrong with the code?
It's a programming error. Have you looked what the method does? Or what it says that does?
Returns a copy of the image scaled to a rectangle with the given width and height according to the given aspectRatioMode and transformMode.
Òscar Llarch i Galán
thanks for the hint.
![]()
Bookmarks