Answer the question
In order to leave comments, you need to log in
How to calculate required width and height of two images?
Yes tableRow
, two are placed in it ImageView
. Photos are ImageView
uploaded in various sizes. It is necessary to change the scale of each photo (fit to the same height) (example below)
There are no problems with photos of the same size, I do everything as follows:
Answer the question
In order to leave comments, you need to log in
There are 2 images with width and height values (w1,h1) and (w2,h2). The total width of two images after transformation is known: W.
It is required to find the coefficients k1 and k2 of proportional scaling of two images so that the modified images:
Solve this system of equations. I managed
k1 = W / ( w2 * ( h1/h2 + w1/w2))
k2 = k1 * (h1/h2)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question