Jump to content

Division of @desktorwidth and @desktopheight ?


Recommended Posts

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 ?

Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
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...