ForsakenGod Posted December 29, 2009 Share Posted December 29, 2009 Hello,I would like to ask if its possible to make some kind of forumula that would count some area on the screen even if the resolution changes For example i would like to target an specific area on the screen independent of its reso . An example may be this pic Would it be possible to count it somehow or it has to be dont manually ? Link to comment Share on other sites More sharing options...
jebus495 Posted December 29, 2009 Share Posted December 29, 2009 Hello, I would like to ask if its possible to make some kind of forumula that would count some area on the screen even if the resolution changes For example i would like to target an specific area on the screen independent of its reso . An example may be this pic Would it be possible to count it somehow or it has to be dont manually ? It's quite possible if you find the exact proportions you need. Here's an example of how people center a 500x500 gui on a screen. $Form1 = GUICreate("Form1", 500, 500, (@DesktopWidth / 2) - 250, (@DesktopHeight / 2) - 250) You can use the same strategy for other functions as well like PixelSearch and PixelCheckSum. Link to comment Share on other sites More sharing options...
ForsakenGod Posted December 29, 2009 Author Share Posted December 29, 2009 (edited) It's quite possible if you find the exact proportions you need. Here's an example of how people center a 500x500 gui on a screen. $Form1 = GUICreate("Form1", 500, 500, (@DesktopWidth / 2) - 250, (@DesktopHeight / 2) - 250) You can use the same strategy for other functions as well like PixelSearch and PixelCheckSum. Well this is cool but i ve to think a bit about it What it does it divides width and height by 2 that makes the down edge of this object the middle of screen and than it subsides 250 so that means it shifts all edges by -250 right ? Edited December 29, 2009 by ForsakenGod Link to comment Share on other sites More sharing options...
jebus495 Posted December 29, 2009 Share Posted December 29, 2009 (edited) Try out this working example for a clearer understanding. You can alter the formula until you see the GUI in the same shape that you want your rectangle in (By applying the formula to the width and height parameters) and then copy it over to whatever you're doing. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 500, 500, (@DesktopWidth / 2) - 250, (@DesktopHeight / 2) - 250) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Sleep(50) WEnd Edit: Doing what you need is basically just being creative with math. Edited December 29, 2009 by jebus495 Link to comment Share on other sites More sharing options...
ForsakenGod Posted December 29, 2009 Author Share Posted December 29, 2009 (edited) Try out this working example for a clearer understanding. You can alter the formula until you see the GUI in the same shape that you want your rectangle in (By applying the formula to the width and height parameters) and then copy it over to whatever you're doing. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 500, 500, (@DesktopWidth / 2) - 250, (@DesktopHeight / 2) - 250) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Sleep(50) WEnd Edit: Doing what you need is basically just being creative with math. Cool thank you Re: After ur example i made what i wanted in 2 mins thank you !!!: ) Edited December 29, 2009 by ForsakenGod 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