Screenshoot rahmen abschneiden

  • Hallo,

    Ich mache mit dieser funktion einen Screen.

    [autoit]

    _ScreenCapture_CaptureWnd(@ScriptDir & "\screen.jpg", $hWnd)

    [/autoit]


    Dabei kommt ein Bild mit nem kleinen schwarzen rahmen und unten teilweise die Windows Leiste.
    Wie schneid ich den ab?

  • Probiere es mal mit dieser Funktion:

    [autoit]


    Func __ScreenCapture_CaptureWnd($sFileName, $hWnd, $iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1, $maximized = False)
    Local $dex = 4, $dey = 1
    Local $tRect = _WinAPI_GetWindowRect($hWnd)
    If BitAND($maximized, 32) Then
    $dex = 8
    $dey = 8
    EndIf
    $iLeft += DllStructGetData($tRect, "Left")
    $iTop += DllStructGetData($tRect, "Top")
    If $iRight = -1 Then $iRight = DllStructGetData($tRect, "Right") - DllStructGetData($tRect, "Left")
    If $iBottom = -1 Then $iBottom = DllStructGetData($tRect, "Bottom") - DllStructGetData($tRect, "Top")
    $iRight += DllStructGetData($tRect, "Left")
    $iBottom += DllStructGetData($tRect, "Top")
    If $iLeft > DllStructGetData($tRect, "Right") Then $iLeft = DllStructGetData($tRect, "Left")
    If $iTop > DllStructGetData($tRect, "Bottom") Then $iTop = DllStructGetData($tRect, "Top")
    If $iRight > DllStructGetData($tRect, "Right") Then $iRight = DllStructGetData($tRect, "Right")
    If $iBottom > DllStructGetData($tRect, "Bottom") Then $iBottom = DllStructGetData($tRect, "Bottom")
    Return _ScreenCapture_Capture($sFileName, $iLeft + $dex, $iTop + $dey, $iRight - $dex, $iBottom- $dey, False)
    EndFunc ;==>_ScreenCapture_CaptureWnd

    [/autoit]

    Ist aus AutoIt Windows Screenshooter .

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯

  • hab die Funktion mal ein wenig umgeschrieben:

    [autoit]

    #include <ScreenCapture.au3>
    $sPath = @DesktopDir & "\screen.jpg"
    $hWnd = WinGetHandle("Dein Fenster :D")
    _ScreenCapture_CaptureOwnWnd($sPath, $hWnd)

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

    Func _ScreenCapture_CaptureOwnWnd($sPath, $hWnd)
    $Titel = WinGetTitle($hWnd)
    $Pos = WinGetPos($Titel)
    _ScreenCapture_Capture($sPath, $Pos[0] + 8, $Pos[1] + 8, ($Pos[2] - $Pos[0]) - 24, ($Pos[3] - $Pos[1]))
    EndFunc ;==>_ScreenCapture_CaptureOwnWnd

    [/autoit]

    mfg BB

    "IF YOU'RE GOING TO KILL IT
    OPEN SOURCE IT!"

    by Phillip Torrone

    Zitat von Shoutbox

    [Heute, 11:16] Andy: ....böseböseböseböse....da erinnere ich mich daran, dass man den Puschelschwanz eines KaRnickels auch "Blume" nennt....ob da eins zum anderen passt? :rofl: :rofl: :rofl: :rofl:

    https://autoit.de/index.php?page…leIt#post251138

    Neon Snake