PixelCheckSum() farbabhängig

  • hallo,(Sc3) :hammer:
    kann jemand mal fix pixelshecksum so anpassen,
    daß z.B. nur weiss beachtet wird?

    etwa so:
    PixelChecksum(100,100,105,107, 16777215)

    Danke @Berti

    Einmal editiert, zuletzt von bertizwo (6. Januar 2007 um 00:17)

    • Offizieller Beitrag

    Hallo!

    Pixelchecksum kann man nicht anpassen das es nur weiss beachtet! Mit PixelChecksum wird eine Checksumme aus den Pixeln gebildet die in dem angegebene Bereich liegen, mit dem 5. Parameter kann nur angeben das nicht alle Pixel in die Checksumme einbezogen werden, ein Wert > 1 ist aber laut Hilfe nicht empfohlen!

    Wenn Du nur weisse Pixel willst musst Du einen Bereich erstellen der nur aus weissen Pixel besteht und dann daraus die Checksumme bilden!

    • Offizieller Beitrag

    Hi,

    vielleicht hilft dir ja das:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    HotKeySet("{ESC}", "_end")
    HotKeySet("{F2}", "_check")

    [/autoit] [autoit][/autoit] [autoit]

    Global $start = MouseGetPos()

    [/autoit] [autoit][/autoit] [autoit]

    $gui = GUICreate("GUI", 30, 30, $start[0] - 15, $start[1] - 15, $WS_POPUP, $WS_EX_TOPMOST)
    GUISetBkColor(0x00FF00)

    [/autoit] [autoit][/autoit] [autoit]

    _GUICreateInvRect($gui, 5, 5, 20, 20)
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    Sleep(10)
    $now = MouseGetPos()
    WinMove($gui, "", $now[0] - 15, $now[1] - 15)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _check()
    $pos = WinGetPos($gui)
    $pCkSum = PixelChecksum($pos[0], $pos[1], $pos[0] + $pos[2], $pos[1] + $pos[3])
    ConsoleWrite($pCkSum & @LF)
    MsgBox(64, "Pixel Checksum of " & $pos[0] & " " & $pos[1]& " " & $pos[0] + $pos[2]& " " & $pos[1] + $pos[3], "Checksum: " & $pCkSum)
    EndFunc ;==>_check

    [/autoit] [autoit][/autoit] [autoit]

    Func _GUICreateInvRect($hwnd, $l, $t, $w, $h)
    $pos = WinGetPos($hwnd)

    [/autoit] [autoit][/autoit] [autoit]

    $1 = 0
    $2 = 0
    $3 = $pos[2]
    $4 = $t
    $ret = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
    $1 = 0
    $2 = 0
    $3 = $l
    $4 = $pos[3]
    $ret2 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
    $1 = $l + $w
    $2 = 0
    $3 = $pos[2]
    $4 = $pos[3]
    $ret3 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
    $1 = 0
    $2 = $t + $h
    $3 = $pos[2]
    $4 = $pos[3]
    $ret4 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret2[0], "int", 2)
    DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret3[0], "int", 2)
    DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret4[0], "int", 2)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hwnd, "long", $ret[0], "int", 1)
    EndFunc ;==>_GUICreateInvRect

    [/autoit] [autoit][/autoit] [autoit]

    Func _end()
    Exit (0)
    EndFunc ;==>_end

    [/autoit]

    So long,

    Mega