Jump to content

converting x.y coords from one resolution to another.


Recommended Posts

  • Developers

No idea what you mean but it sounds like you are looking for a PerformMagic() function.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Again...  what did you try already that isn't working? 

..and I can't think of any automation issues that would need this amount of conversions anyways.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

see if help!

$position = coords(1600, 900, 1366, 768, 84, 822)
MsgBox(4096, "Result", "Left: " & $position[1] & @CRLF & "Top: " & $position[2])

Func coords($res_w_before = 0, $res_h_before = 0, $res_w_now = 0, $res_h_now = 0, $left = 0, $top = 0)
    Local $array[3]
    Local $horiz = $res_w_before / $left
    Local $vert = $res_h_before / $top
    $array[1] = $res_w_now / $horiz
    $array[2] = $res_h_now / $vert
    Return $array
EndFunc   ;==>coords

 

Edited by Belini
Link to comment
Share on other sites

3 hours ago, yellowmellow said:

no issues, i just dont know if i can somehow convert that exact click to happen on the new resolution but i guess im thinking wrong here, since its a different resulution i will never be able to click the same location on screen on different resolution

 

middle is always @desktopwidth/2 and @desktopheight/2, so is there a reason you cant do everything as a percentage of those two macros rather than absolutes?

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...