How can I run canvas coordinates in different sizes?

I use canvas to control the computer mouse from the phone, but I could not adjust the x, y coordinates of the canvas to the computer. I searched as scale but couldn’t find a result.

All coordinate information is available in the picture below.

image

When I select a coordinate on the canvas, I want it to be compatible with the computer’s screen. I canvas click (1, 1) when get coord. (1, 1) or I canvas click (423, 749) when convert (1920, 1080).

What should I do for canvas scale convert?

x=(x1 / x2) * x3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.