Sign in to follow this  
Followers 0
KurogamineNox

Pixel question.

4 posts in this topic

What's the difference between PixelSearch() and PixelGetColor()?

Share this post


Link to post
Share on other sites

Did you look at those functions in the helpfile?

One returns where it find a certain colour in a given region, the other returns what colour is at a certain position.


GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

;PixelSearch ( left, top, right, bottom, color [, shade-variation [, step [, hwnd]]] )

;Without used Window handle

;Search color IN Screen

Form Screen left------TO ----Screen right
From Screen_top     From Screen_top
-                                   -
-   looking color inside this box   -                                -
TO                                 TO
-                                   -
-                                   -
Screen_bottom           Screen_bottom
Form Screen left------TO ----Screen right

$color = 0xFF0000
$Screen_left = 100
$Screen_top = 100
$Screen_right = 200
$Screen_bottom = 200
$coord = PixelSearch( $Screen_left,$Screen_top,$Screen_right,$Screen_bottom,$color)
if @error Then
MsgBox(0,"MSG","color is not found")
Else
MsgBox(0,"MSG","color is found inside this box In Screen_left " _
& $coord[0] & " " & @CRLF & "And inside this box In Screen_top " & $coord[1])
EndIf

;Get color From Screen

;Get color From Screen
$Screen_left = 100
$Screen_top = 100
$color = PixelGetColor($Screen_left,$Screen_top)
MsgBox(0,"The decimal color is", $color)
MsgBox(0,"The hex color is", Hex($color, 6))
Edited by wolf9228

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites

;PixelSearch ( left, top, right, bottom, color [, shade-variation [, step [, hwnd]]] )

;Without used Window handle

;Search color IN Screen

Form Screen left------TO ----Screen right
From Screen_top     From Screen_top
-                                   -
-   looking color inside this box   -                                -
TO                                 TO
-                                   -
-                                   -
Screen_bottom           Screen_bottom
Form Screen left------TO ----Screen right

$color = 0xFF0000
$Screen_left = 100
$Screen_top = 100
$Screen_right = 200
$Screen_bottom = 200
$coord = PixelSearch( $Screen_left,$Screen_top,$Screen_right,$Screen_bottom,$color)
if @error Then
MsgBox(0,"MSG","color is not found")
Else
MsgBox(0,"MSG","color is found inside this box In Screen_left " _
& $coord[0] & " " & @CRLF & "And inside this box In Screen_top " & $coord[1])
EndIf

;Get color From Screen

;Get color From Screen
$Screen_left = 100
$Screen_top = 100
$color = PixelGetColor($Screen_left,$Screen_top)
MsgBox(0,"The decimal color is", $color)
MsgBox(0,"The hex color is", Hex($color, 6))

Ty alot, it worked mighty well.

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