Sign in to follow this  
Followers 0
ForsakenGod

Division of @desktorwidth and @desktopheight ?

5 posts in this topic

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 Posted Image

Would it be possible to count it somehow or it has to be dont manually ?

Share this post


Link to post
Share on other sites



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 Posted Image

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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by ForsakenGod

Share this post


Link to post
Share on other sites

#4 ·  Posted (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. :evil:

Edited by jebus495

Share this post


Link to post
Share on other sites

#5 ·  Posted (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. :evil:

Cool thank you :evil:

Re: After ur example i made what i wanted in 2 mins thank you !!!: )

Edited by ForsakenGod

Share this post


Link to post
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
Sign in to follow this  
Followers 0