Jump to content

Pixel question.


Recommended Posts

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.
Link to comment
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))
Edited by wolf9228

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

 

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