Sign in to follow this  
Followers 0
Phydough66

pixelsearch and pixelgetcolor

4 posts in this topic

From what I have read pixel search looks for a rectangle of pixels, I believe the online help file says. I have been looking for more information on these 2 functions but I am coming up with a big empty. I was wondering if someone could try and explain to me exactly what these functions do.The help file gives a very very brief 1 line explanation. I understand what a pixel is and the pixelgetcolor I understand that one more than the pixelsearch itself. Maybe someone could give me a begginers walkthrough on the use of these functions?

Thanks in advance

Phy

Share this post


Link to post
Share on other sites



The manual is really clear.

Pixelsearch can be called with with 2 locations wich together form a regtangle.

The function searches for a pixel within the square (the color you choose)

if it finds a pixel with that color it stops looking and returns a aray with the x and y coordinates

of the pixel wich has the color

It only finds the first pixel if there are more they are not returned because it only return the first one

It scans from left to right and after one line it goes one line down.

pixelgetcolor just returns the color of the pixel of wich you requested x y coordinates.

in short

Pixelsearch scans a region for a pixel with a certain color and returns the coordinates

pixelgetcolor returns the color of one pixel with the certain x y coordinates

Share this post


Link to post
Share on other sites

Thanks for replying I now understand.

Phy

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

if u dont need to scan for a pixel and know where it is always.

make it like this

$value = (decimal value goes here)

$color = pixelgetcolor (x , y)

;itll return the decimal color of the scanned x,y

;meaning u need to

IF $color = $value Then

code

Else (expression) then

code

Endif

OR use case.

or i suppose if u really need advanced checks u could case inside an if i suppose

or if your trying to detect changes made in a general area of pixels use a static checksum for things like buttons in games etc.

Edited by lol98

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