Jump to content

pixelsearch on multiple monitor/extended display


Recommended Posts

Pixelsearch is one oft the worst and unsafest ways to automate a application. There are much better ways for automation, so please: tell the name of the apllication you want to automate for finding a good solution.

Edited by AutoBert
Link to comment
Share on other sites

On 5/29/2016 at 5:34 PM, christian11 said:

so it would be 

green=PixelSearch(-1, -1, @DesktopWidth, @DesktopHeight, 0x00FF00)

is it correct??

No. As an example, let's say your monitor setup is the following:

Monitor 1 (main) has a resolution of 1920x1080. This monitor is to the right of Monitor 2

Monitor 2 (secondary) has a resolution of 1024x768. This monitor is to the left of Monitor 1.

 

The top left pixel of the monitor 1 is 0x0.

The top right pixel of the monitor 1 is 1920x0.

The center pixel of monitor 1 is 960x540.

The bottom left pixel of the monitor 1 is 0x1080.

The bottom right pixel of the monitor 1 is 1920x1080.

 

The top left pixel of the monitor 2 is -1024x0.

The top right pixel of the monitor 2 is -1x0.

The center pixel of monitor 2 is -512x384.

The bottom left pixel of the monitor 2 is -1024x768.

The bottom right pixel of the monitor 2 is -1x768.

 

Try to think of it like plotting boxes on a horizontally (x) inverted axis graph. Right is +x, Down is +y, Left is -x, and Up is -y.

If you are unsure as where your monitors are positioned, refer to Control Panel's Display Resolution page. 

"Control Panel\All Control Panel Items\Display\Screen Resolution"

 

Edited by BetaLeaf
Fixed coordinates.

 

 

Link to comment
Share on other sites

5 hours ago, Bert said:

in this case it is NOT the only option that works.

Look man I'm just trying to help. We don't know what the op is even trying to do, we haven't seen the full code. How can you be so sure stuff doesn't work when you don't know what the op is trying to do. For all we know, he might be trying to automate a Java based speed test. We just don't know so don't be so sure. Everything is case by case, some stuff works, others dont. Sorry if you don't like my opinion.

 

 

Link to comment
Share on other sites

2 hours ago, BetaLeaf said:

Look man I'm just trying to help. We don't know what the op is even trying to do, we haven't seen the full code.

We don't know what op trying to do in case of he's not saying exactly what he want to do and isn't anwering:

 

21 hours ago, Bert said:

please post your code

and when a MVP ask, it's usual noone give further support until question is answered.

Link to comment
Share on other sites

  • Moderators
1 hour ago, AutoBert said:

and when a MVP ask, it's usual noone give further support until question is answered.

Not sure where you picked that up from...

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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