Jump to content

PixelSearch


Recommended Posts

Hi,

I'm brand new to AutoIt and have only programmed a TI-83, so please forgive me if I end up on here every day asking dumb questions. Anyhow, I want to do a pixel search of an area, but I don't want it to be a straight up and down rectangle (it's more like a rectangle rotated 45 degrees). The coordinates that are required in PixelSearch don't seem to allow this, however. Am I missing something or is there a way to get around this?

Link to comment
Share on other sites

  • Moderators

Hi,

I'm brand new to AutoIt and have only programmed a TI-83, so please forgive me if I end up on here every day asking dumb questions. Anyhow, I want to do a pixel search of an area, but I don't want it to be a straight up and down rectangle (it's more like a rectangle rotated 45 degrees). The coordinates that are required in PixelSearch don't seem to allow this, however. Am I missing something or is there a way to get around this?

I don't know if you are missing something, maybe just mis-understanding?

Local $xTopLeft_StartPosition = 0
Local $yTopLeft_StartPosition = 0
Local $xBottomRight_EndPosition = 200
Local $yBottomRight_EndPosition = 100
Local $iColor = 0xFF0000 ; Hex color
Local $iShadeVariation = 10 ; up to 10 shades differnce either way
Local $iStep = 0 ; how many pixels to skip each search

$aPSearch = PixelSearch($xTopLeft_StartPosition, $yTopLeft_StartPosition, $xBottomRight_EndPosition, $yTopLeft_StartPosition, $iColor, $iShadeVariation, $iStep)
If IsArray($aPSearch) Then MsgBox(64, 'Info:', 'X Found is : ' & $aPSearch[0] & @CR & 'Y Found is : ' & $aPSearch[1])
Hope that helps.

Edit:

Seems that Ebonics was overcomming my itterations.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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