Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate the same position on different bitmaps?

Tags:

android

I have 2 photos, one has a dimension of 300x300 and the other one is 1200x1200. I drew one text to the position A = (50, 40) in the 300x300 image.

How can I calculate the same position A on the 1200x1200 image?

UPDATE 2:

IF dimension is not round (such as 523 x 412...) - x, y after multiply will be deflected

like image 885
Thanh Le Avatar asked Nov 18 '25 22:11

Thanh Le


1 Answers

you may go with relative position calculation as follows.

AAx = (50/300)*1200; 

AAy = (50/300)*1200;

so your new position will be AA = (200,200)

like image 82
Amit K. Saha Avatar answered Nov 21 '25 13:11

Amit K. Saha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!