I am building some drawing apps that require to track the XY coordinate of user drawing rectangle (it can be multiple rectangle) on image. Now i have bump into a problem is i do not know how to track the XY coordinate of each rectangle after image is scaled up. A better illustration of my problem can be shown in the below figure. Do any experts here have an solution how to calculate the XY coordinates after scaled up/down? Thanks
Asked
Active
Viewed 216 times
0
-
Translate the origin to the center of the scaling, multiply everything by the scale factor, and then translate back. – amd Apr 22 '20 at 20:56
-
Hey @amd thanks for your propose method and it's works! – CodeNameBobby Apr 27 '20 at 05:45
