Jump to content

capturing gui and saving it as a jpg file


Recommended Posts

Hey guys,

I saw this code on another thread. I want to make a new thread so it's cleaner.

;----------------------------------------------------------------
;;;;;The very first pixel should be as unique as possible...
;----------------------------------------------------------------
$info = _ImageSearchGetInfo(326,313,339,331)

$xy = _ImageSearch(0,0,640,480,$info)
If Not @error Then MsgBox(4096,"",$xy[0] & "," & $xy[1])

Func _ImageSearchGetInfo($l,$t,$r,$b)
    Dim $array[4]
    $color = PixelGetColor($l, $t)
    $chksum = PixelChecksum($l, $t, $r, $b)
    $array[0] = $r - $l
    $array[1] = $b - $t
    $array[2] = $color
    $array[3] = $chksum
    Return $array
EndFunc

Func _ImageSearch($left,$top,$width,$height,$ISarray)
    $x = $left
    $y = $top
    $boundX = $left + $width
    $boundY = (($top + $height) - $ISarray[1])

    While $x <= $boundX And $y <= $boundY
        $initXY = PixelSearch($x, $y, $boundX, $y, $ISarray[2])
        If Not @error Then
            If $ISarray[3] = PixelChecksum($initXY[0], $initXY[1], $initXY[0] + $ISarray[0], $initXY[1] + $ISarray[1]) Then
                Return $initXY
            Else
                If ($initXY[0] + $ISarray[0]) > $boundX Then
                    $y = $y + 1
                Else
                    $x = $initXY[0] + 1
                EndIf
            EndIf
        Else
            $y = $y + 1
        EndIf
    WEnd
    SetError(1)
EndFunc

Can someone please tell me how I can use this function to capture a msgbox? Or, I saw another thread but couldn't recall where. There was a function wherein we can specify a coordinate and capture the text sitting on the msgbox(no controls or classname on text). Then once we have that text captured, it can be compared against a font, something like this......Can someone please show me how?

Thanks,

Neil

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