Jump to content

Recommended Posts

Posted

I have a desktop application where I would like to watch a certain spot related to window's bottom edge. Btw: it's not a game.

Reason is that this particular program can't create events on status warnings, only display them. With my utility this function is added.

But.. in debugging I would like to mark the area where I check for pixel.

I have found something in but I am not sure how to remote the rectangle again. I only need it to appear f.ex every 5th second or so and disappear again.

It can also be a dot / circle / whatever, not important.

My code so far - this works just fine.

Func _get_color()
; called every 2 seconds
; using ADLIB function
; $handle is already from window.
Local $p = WinGetPos($handle)
If Not IsArray($p) Then
MsgBox(4096, "error", "Could not get pos of handle")
EndIf

; we look just a one box... 16x16 px
Local $FromLeftEdge = 153 ; area start from edge of window
Local $FromBottomUp = 30 ; bottom of dot from bottom of window
Local $x = $p[0]
Local $y = $p[1]
Local $by = $p[3] + $y ; bottom of window = ypos + height
Local $coord = PixelSearch($x + $FromLeftEdge, _ ; LEFT START
$by - $FromBottomUp - 16, _ ; TOP .. we take 16 pixel offset here..
$x + $FromLeftEdge + 16, _ ; RIGHT (16 pixel again)
$by - $FromBottomUp, _ ; BOTTOM
0xFFFFFF, _ ; COLOR TO LOOK FOR
0, 1, _ ; EXACT color
$handle)
If Not @error Then
;
;action if found
Else
; action if not found
EndIf
EndFunc ;==>_get_color

I am just a hobby programmer, and nothing great to publish right now.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...