Screenshot

  • hi, habe irgendwo ein script gefunden mit dem man Screenshots erstellen kann. Klappt auch soweit wunderbar, suche nun ne Möglichkeit, das das Bilderspeichern immer ein weiterzählt. Beispiel Screenshot.jpg wird erstellt, wird nun das script gestartet soll die alte datei nicht überschrieben werden, sondern Screenshot1.jpg > Screenshot2.jpg usw... sollen neu gespeichert werden, wenn das überhaupt geht. Wäre schön wenn mir da einer weiterhelfen könnte.

  • Spoiler anzeigen
    [autoit]

    ;~ #include <WinFX.au3>
    ;WinFX.au3-Funktion: FlashDesktop:
    Func _WinFX_FlashDesktop($iSpeed=3,$hColor=0xffffff)
    ;Remarks: Don't use AdLib with this
    GUICreate("Flash",@DesktopWidth,@DesktopHeight,0,0,0x80000000,0x00000080)
    GUISetBkColor($hColor)
    WinSetTrans("Flash","",240)
    GUISetState()
    For $i=100 To 255 step 5
    WinSetTrans("Flash","",$i)
    Next
    For $i=255 To 0 step -$iSpeed
    WinSetTrans("Flash","",$i)
    Next
    if not @error then return true
    EndFunc
    #include <Screencapture.au3>
    HotKeySet("{PRINTSCREEN}","_screen")
    If not FileExists("D:\Files\Screenshots\") Then DirCreate("D:\Files\Screenshots\")
    Func _screen()
    HotKeySet("{PRINTSCREEN}")
    $i=1
    While FileExists("D:\Files\Screenshots\pic" & $i & ".jpg")
    $i += 1
    WEnd
    _ScreenCapture_Capture("D:\Files\Screenshots\pic" & $i & ".jpg")
    _WinFX_FlashDesktop(1)
    HotKeySet("{PRINTSCREEN}","_screen")
    EndFunc
    While True
    sleep(200)
    WEnd

    [/autoit]


    ist aus nem alten Tool von mir...

    Twitter: @L3viathan2142
    Benutze AutoIt persönlich nicht mehr, da ich keinen Windows-Rechner mehr besitze.

  • ..oder so...

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <ScreenCapture.au3>
    #include <Array.au3>
    #include <String.au3>
    ToolTip("Screenshot Aufruf mit F10", 30, 30)

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

    dim $array[1]
    local $maxnumber=0
    $filename="Screenshot"
    $ext=".jpg"
    $search=$filename&"*"&$ext
    $hfile=FileFindFirstFile($search) ;datei mit "screenshot" suchen
    if not @error and $hfile<>-1 then ;wenn es diese Datei gibt
    While 1
    $file = FileFindNextFile($hfile) ;Dateinamen holen
    If @error Then ExitLoop ;gibt keine Dateien mehr im verzeichnis
    $filenumber=_stringbetween($file,$filename,$ext) ;nummer aus dem filenamen holen
    if number($filenumber[0])>$maxnumber then $maxnumber=number($filenumber[0]) ;grösste nummer merken
    WEnd
    endif
    $maxnumber+=1 ;eins erhöhen

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

    ;If FileExists(@scriptdir&"\Screenshot.jpg") Then Exit
    HotKeySet("{F10}", "start1")
    While 1
    sleep (50)
    WEnd

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

    Func start1()
    HotKeySet("{F10}")
    Opt("MustDeclareVars", 1)
    Global $hBitmap, $hImage, $hGraphic, $hFamily, $hFont, $tLayout, $hFormat, $aInfo, $hBrush1, $hBrush2, $iWidth, $iHeight, $hPen
    Global $sString=" Created with AutoIt "
    _GDIPlus_StartUp()
    $hBitmap = _ScreenCapture_Capture(@scriptdir & "\"&$filename&$maxnumber&$ext)
    $hImage = _GDIPlus_ImageLoadFromFile(@scriptdir & "\"&$filename&$maxnumber&$ext)
    $hGraphic = _GDIPlus_ImageGetGraphicsContext($hImage)
    $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    $hFont = _GDIPlus_FontCreate($hFamily, 16, 1)
    $tLayout = _GDIPlus_RectFCreate(0, 0)
    $hFormat = _GDIPlus_StringFormatCreate(2)
    $hBrush1 = _GDIPlus_BrushCreateSolid(0xA2FFFFFF)
    $hBrush2 = _GDIPlus_BrushCreateSolid(0xC4FF0000)
    $hPen = _GDIPlus_PenCreate(0xC4000000, 2)
    $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat)
    $iWidth = DllStructGetData($aInfo[0], "Width" )
    $iHeight = DllStructGetData($aInfo[0], "Height")
    _GDIPlus_ImageSaveToFile($hImage, @scriptdir & "\"&$filename&$maxnumber&$ext)
    _GDIPlus_PenDispose ($hPen )
    _GDIPlus_BrushDispose ($hBrush1 )
    _GDIPlus_BrushDispose ($hBrush2 )
    _GDIPlus_StringFormatDispose($hFormat )
    _GDIPlus_FontDispose ($hFont )
    _GDIPlus_FontFamilyDispose ($hFamily )
    _GDIPlus_GraphicsDispose ($hGraphic)
    _GDIPlus_ImageDispose ($hImage )
    _GDIPlus_ShutDown()
    ShellExecute(@scriptdir&"\"&$filename&$maxnumber&$ext)
    HotKeySet("{F10}", "start1")
    EndFunc

    [/autoit]