• Der Nutzer wählt einen beliebigen Ordner mit den Bilddateien (*.jpg), die Anzahl der Bilder im Ordner sind noch unbekannt.
    Der kleine Bildbetrachter ermittelt Anzahl, Bezeichnung des Bildermaterials und erstellt eine Bilderpräsentation.
    Die Bilder können in einzelnen Schritten vorwärts, rückwärts oder als Diashow betrachtet werden. Die Bildwechselzeit ist einstellbar und eine laufende Diashow kann unterbrochen werden.

    Sprache: Deutsch
    Betriebssysteme: Windows XP bis Windows 8 64bit
    Version: PhotoViewer.1146_2013-09-28

    Danke für die Downloads bisher : 47

    Spoiler anzeigen
    [autoit]


    #RequireAdmin
    #region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Icon=mona.ico
    #AutoIt3Wrapper_Outfile=PhotoViewer.exe
    #AutoIt3Wrapper_UseUpx=n
    #AutoIt3Wrapper_Res_Description=Kleiner Bildbetrachter
    #AutoIt3Wrapper_Res_Fileversion=1.1.4.6
    #AutoIt3Wrapper_Res_LegalCopyright=© by Ritzelrocker04
    #AutoIt3Wrapper_Res_Language=1031
    #AutoIt3Wrapper_Res_Field=Compiled by|Ritzelrocker04
    #AutoIt3Wrapper_Res_Field=Original Name|AutoIt PhotoViewer
    #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
    #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

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

    #include <ComboConstants.au3>
    #include <Date.au3>
    #include <EditConstants.au3>
    #include <File.au3>
    #include <GDIPlus.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiStatusBar.au3>
    #include <Misc.au3>
    #include <StaticConstants.au3>

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

    Opt('MustDeclareVars', 1)

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

    OnAutoItExitRegister("_quit")
    _GDIPlus_Startup()

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

    FileInstall('autoit9_wall.jpg', @TempDir & "\autoit9_wall.jpg", 1)
    Global $Msg, $tartpic = @TempDir & "\autoit9_wall.jpg"
    Global $ourcePath, $path, $PicList, $how = 1, $PicSwitchTime = 1000, $tepPic = 0
    Global $hGraphics, $hImage, $hBrush_Grey, $iX, $iY, $iW, $iH
    ;$sVersion = "0.36 " wird erst nach dem kompilieren wirksam.
    Global $sTitle = "AutoIt PhotoViewer ", $sDate = "28.09.2013 ", $sVersion = FileGetVersion(@ScriptFullPath)
    Global $sMsgUpdate = '%s\n\nDer Nutzer wählt einen beliebigen Ordner' _
    & '\nmit den Bilddateien (*.jpg), die Anzahl der Bilder\nim Ordner sind noch unbekannt.\n\n' _
    & 'Der kleine Bildbetrachter ermittelt Anzahl, Bezeichnung\ndes Bildermaterials und erstellt eine Bilderpräsentation.' _
    & '\n\nDie Bilder können in einzelnen Schritten\nvorwärts, rückwärts oder als Diashow betrachtet werden.\n' _
    & 'Die Bildwechselzeit ist einstellbar und\neine laufende Diashow kann unterbrochen werden.' _
    & '\n\nVersion:\t%s\nBuild:\t%s\n\nCopyright: © 2013 by Ritzelrocker04\n\nAutor:\nRitzelrocker04 / RR04' _
    & '\nritzelrocker04.bplaced.net\n\nWeiter zur Homepage ?'

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

    Global $hGui = GUICreate($sTitle, 1000, 618)

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

    #region ### Group Präsentation ###
    Global $pic = GUICtrlCreatePic($tartpic, 10, 10, 660, 500)
    Global $lblLabel = GUICtrlCreateLabel(StringFormat('%s', $sTitle), 20, 520, 640, 22, $SS_CENTER)
    GUICtrlSetFont(-1, 11, 400, 0, "Arial")
    #endregion ### Group Präsentation ###

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

    #region ### Group Information ###
    GUICtrlCreateLabel('', 680, 10, 310, 360)
    GUICtrlSetBkColor(-1, 0xCBCBCB)
    GUICtrlSetState(-1, $GUI_DISABLE)
    Global $iptInfo[4]
    For $i = 0 To 3
    $iptInfo[$i] = GUICtrlCreateInput("", 700, 60 + $i * 80, 270, 22, $ES_READONLY)
    GUICtrlSetBkColor(-1, 0xffffff); 0x000000 ; 0xffffff ; 0xCBCBCB
    Next
    #endregion ### Group Information ###

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

    Global $iptSourcePath = GUICtrlCreateInput("", 10, 562, 660, 22, $ES_READONLY)
    GUICtrlCreateLabel("Die Zeit in Sekunden bis zum Bildwechsel.", 680, 425, 310, 17, $SS_CENTER)
    Global $cmbSwitchTime = GUICtrlCreateCombo("3", 680, 445, 310, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
    GUICtrlSetData(-1, "2|4|5|6", "3")
    Global $btnLeft = GUICtrlCreateButton("<", 680, 390, 150, 25)
    Global $btnRight = GUICtrlCreateButton(">", 840, 390, 150, 25)
    Global $btnShow = GUICtrlCreateButton("Show starten", 680, 480, 150, 25)
    GUICtrlSetState($btnShow, $GUI_FOCUS)
    Global $btnShowCancel = GUICtrlCreateButton("Show beenden", 840, 480, 150, 25)
    ;~ Show beenden beendet nicht das Programm !
    GUICtrlSetState($btnShowCancel, $GUI_DISABLE)
    GUICtrlCreateLabel("Den Bildpfad auswählen.", 680, 540, 310, 17, $SS_CENTER)
    Global $btnFolder = GUICtrlCreateButton("...", 680, 560, 310, 25)

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

    #region ### StatusBar ###
    Global $tatusBar = _GUICtrlStatusBar_Create($hGui)
    Global $tatusBar_PartsWidth[2] = [900, -1]
    _GUICtrlStatusBar_SetParts($tatusBar, $tatusBar_PartsWidth)
    _GUICtrlStatusBar_SetText($tatusBar, $sTitle & 'v' & $sVersion, 0)
    _GUICtrlStatusBar_SetMinHeight($tatusBar, 20)
    #endregion ### StatusBar ###

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

    GUISetState(@SW_SHOW)

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

    AdlibRegister("_clock", 1000)

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

    While True
    $Msg = GUIGetMsg()
    Switch $Msg
    Case -3
    If MsgBox(64 + 4, $sTitle _
    & ' UpdateCheck', StringFormat($sMsgUpdate, $sTitle, $sVersion, $sDate)) = 6 Then _
    ShellExecute("http://ritzelrocker04.bplaced.net/")
    FileDelete($tartpic)
    Exit

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

    Case $btnFolder
    $path = FileSelectFolder('Bitte das Bildverzeichnis auswählen :', '', 6, $ourcePath, $hGui)
    If StringRight($path, 1) <> '\' Then $path &= '\'
    $ourcePath = $path
    GUICtrlSetData($iptSourcePath, $path)

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

    $PicList = _FileListToArray($path, "*.jpg")
    If @error = 1 Or @error = 4 Then
    MsgBox(16, "Error", "Keine Dateien oder Ordner gefunden.")
    Exit
    EndIf

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

    GUICtrlSetData($iptInfo[0], StringFormat('Bilder gesamt : %i', $PicList[0]))

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

    Case $btnLeft, $btnRight, $btnShow
    _specialEvents()
    EndSwitch
    WEnd

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

    ;~ Vor Verwendung eines der drei Events den Pfad prüfen.
    Func _specialEvents()
    If $path <> '' Then
    Switch $Msg
    Case $btnLeft
    ;i $btnLeft
    $tepPic -= 1
    If $tepPic < 1 Then $tepPic = $PicList[0]
    _picStep()

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

    Case $btnRight
    ;i $btnRight
    $tepPic += 1
    If $tepPic > $PicList[0] Then $tepPic = 1
    _picStep()

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

    Case $btnShow
    ;i $btnShow
    GUICtrlSetState($btnShowCancel, $GUI_ENABLE)
    $PicSwitchTime *= GUICtrlRead($cmbSwitchTime)

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

    Do
    GUICtrlSetData($iptInfo[1], StringFormat('Aktuelles Bild : %i', $how))
    _setImageProportion($path & $PicList[$how])
    GUICtrlSetData($lblLabel, StringFormat('%s', $PicList[$how]))
    _PicSwitchTime($PicSwitchTime)
    $how += 1
    Until $how > $PicList[0]

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

    ;i Startbild anzeigen
    GUICtrlSetImage($pic, $tartpic)
    GUICtrlSetState($btnShowCancel, $GUI_DISABLE)

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

    ;i Hinweis Ende der Show
    GUICtrlSetData($lblLabel, "Fertig - Ende der Bilderschau !")
    MsgBox(64, "Fertig", "Ende der Bilderschau !")
    For $i = 0 To 3
    GUICtrlSetData($iptInfo[$i], '')
    Next
    GUICtrlSetData($iptSourcePath, '')
    GUICtrlSetData($lblLabel, StringFormat('%s', $sTitle))
    $PicSwitchTime = 1000
    $path = ''
    $how = 1
    EndSwitch
    Else
    MsgBox(64, "Eingaben", "Bitte erst den Bildpfad eingeben.")
    EndIf
    EndFunc ;==>_specialEvents

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

    Func _picStep()
    GUICtrlSetData($iptInfo[1], StringFormat('Aktuelles Bild : %i', $tepPic))
    GUICtrlSetImage($pic, $path & $PicList[$tepPic])
    GUICtrlSetData($lblLabel, StringFormat('%s', $PicList[$tepPic]))
    _setImageProportion($path & $PicList[$tepPic])
    EndFunc ;==>_picStep

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

    Func _PicSwitchTime($time)
    Local $tstart = TimerInit()
    While TimerDiff($tstart) < $time
    ;i Mit Ende-Taste oder Button "Show beenden" die Show vorzeitig beenden.
    If GUIGetMsg() = $btnShowCancel Or _IsPressed("23") Then $how = $PicList[0] + 1
    WEnd
    EndFunc ;==>_PicSwitchTime

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

    ; #_setImageProportion# =========================================================================================================
    ; Title .........: _setImageProportion
    ; AutoIt Version : v3.3.8.1 oder höher
    ; Language ......: Deutsch
    ; Description ...: Bilder in einer anderen Größe darstellen, bei gleicher Proportion
    ; Note ..........: Verwendung von GDIPLUS, einpassen der Bilder in einen vorgegebenen Rahmen.
    ; Author(s) .....: Ritzelrocker04
    ; Homepage ......: http://ritzelrocker04.bplaced.net/
    ; ===============================================================================================================================
    Func _setImageProportion($var)
    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
    Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics(660, 500, $hGraphics)
    Local $hBitmapContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)

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

    $hImage = _GDIPlus_ImageLoadFromFile($var)
    Local $width = _GDIPlus_ImageGetWidth($hImage)
    Local $height = _GDIPlus_ImageGetHeight($hImage)

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

    GUICtrlSetData($iptInfo[2], StringFormat('Bildformat: %ipx x %ipx', $width, $height))
    GUICtrlSetData($iptInfo[3], StringFormat('Bildverhältnis: %.3f', $width / $height))

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

    $hBrush_Grey = _GDIPlus_BrushCreateSolid(0xFFCBCBCB)
    _GDIPlus_GraphicsFillRect($hBitmapContext, 0, 0, 660, 500, $hBrush_Grey)

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

    $iH = 640 * $height / $width
    $iY = 10 + (480 - $iH) / 2
    $iX = 10
    $iW = 640
    If $iH > 480 Then
    $iW = 480 / ($height / $width)
    $iX = 10 + (640 - $iW) / 2
    $iY = 10
    $iH = 480
    EndIf

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

    ;~ Das Bild einpassen.
    ;~ _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, $iX, $iY, $iW, $iH)
    _GDIPlus_GraphicsDrawImageRect($hBitmapContext, $hImage, $iX, $iY, $iW, $iH)
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 10, 10, 660, 500)
    EndFunc ;==>_setImageProportion

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

    Func _clock()
    Local $clock = _DateTimeFormat(_NowCalc(), 5)
    _GUICtrlStatusBar_SetText($tatusBar, @TAB & $clock, 1)
    EndFunc ;==>_clock

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

    Func _quit()
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_BrushDispose($hBrush_Grey)
    _GDIPlus_ImageDispose($hImage)
    _GDIPlus_Shutdown()
    EndFunc ;==>_quit
    ; Ende

    [/autoit]
  • Hallo RR04,

    ich möchte mal ein kleines Statement abgeben. Meine Kritikpunkte:

    - Ich würde es gut finden, wenn die Programmoberfläche skalierbar wäre und die Diashow auch Bildschirmfüllend gestartet werden könnte.

    - die Auflösung der Bilder reicht mir nicht. Die Kanten sind ziemlich pixellig.

    Als sich die Updatemeldung öffnete wurde mein Interesse geweckt. Als ich dann aber im Code nur ein Aufruf der Homepage fand, war ich doch etwas enttäuscht. Ich dachte schon, ich kann etwas abschauen.

    Sonst aber ein nettes Programm

    VG Jescho

    MfG Jescho

    Jeder hat mal klein angefangen - aber nicht jeder kommt groß raus!