Answer the question
In order to leave comments, you need to log in
How to scale an image proportionally?
There is a cell, it can be of any size. For example, the cell size is 200x150 pixels and there is a picture that needs to be inserted into the cell. Insert proportionally. The picture can be with any resolution. I tried to write an algorithm, it did not work out. Googling didn't help either. I use qt - QImage. I tried this image.scaled(sz, Qt::KeepAspectRatio) - stretches to fit the cell size. It needs to be stretched/reduced proportionally.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question