V
V
Victor Marquardt2017-06-03 10:51:13
Qt
Victor Marquardt, 2017-06-03 10:51:13

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

1 answer(s)
V
Victor Marquardt, 2017-06-03
@Cempl

I figured it out - I wrote the algorithm myself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question