Info Posted February 19, 2011 Share Posted February 19, 2011 (edited) Let's say my monitor resolution is 800x600 and my friend's monitor resolution is 1500x1000. How do I calculate a pixel coordinate in my screen to the coordinate of my friend's screen? Like if I choose the 400,300 pixel I should get 750,500. I have both my resolution and my friend resolution as vars and the pixel coordinates as well Edited February 19, 2011 by Info Link to comment Share on other sites More sharing options...
UEZ Posted February 19, 2011 Share Posted February 19, 2011 (edited) A very simple math calculation: $myres_w= 800 ;@DesktopWidth $myres_h = 600 ;@DesktopHeight $friends_w = 1500 $friends_h = 1000 $my_x = 400 $my_y = 300 $friends_x = Round(($my_x / $myres_w) * $friends_w, 0) $friends_y = Round(($my_y / $myres_h) * $friends_h, 0) MsgBox(0, "Test", "Friend's coordinate: " & $friends_x & " x " & $friends_y) Br, UEZ Edited February 20, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Info Posted February 19, 2011 Author Share Posted February 19, 2011 THANKS! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now