Jump to content

Leaderboard


Popular Content

Showing most liked content on 07/03/2018 in all areas

  1. 1 point
    @michel almeida não entendi muito bem como quer fazer o visualizador funcionar mas fiz algumas mudanças que depois vc pode alterar para o seu propósito! #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <File.au3> Global $diretorio = "", $foto = 1, $FileList, $max = 0 #region ### START Koda GUI section ### Form=C:\Users\michel\Desktop\menu programadores\Source\Form1.kxf $Form1 = GUICreate("Boot Ecu", 914, 636, 180, 131) $List = GUICtrlCreateList("", 776, 40, 137, 552) $Pic1 = GUICtrlCreatePic("", 0, 40, 761, 561, $SS_CENTERIMAGE) $Dir = GUICtrlCreateButton("Diretorio", 776, 0, 137, 41) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") GUICtrlSetBkColor(-1, 0xFFFF00) $Up = GUICtrlCreateButton("Up", 776, 592, 73, 41) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") $down = GUICtrlCreateButton("Dw", 848, 592, 65, 41) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("", 760, 40, 17, 561) GUICtrlSetState(-1, $GUI_DISABLE) $bar = GUICtrlCreateButton("Sem imagens", 0, 0, 777, 41) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") GUICtrlSetState(-1, $GUI_DISABLE) $Button4 = GUICtrlCreateButton("Total de Imagens = 0", 0, 600, 777, 30) GUICtrlSetFont(-1, 20, 400, 0, "MS Sans Serif") GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $down If $max > 0 Then $foto += 1 If $foto >= $max Then $foto = 1 gui($foto) EndIf Case $Up If $max > 0 Then $foto -= 1 If $foto <= 0 Then $foto = $max gui($foto) EndIf Case $Dir $diretorio = FileSelectFolder("escolha uma pasta", "") Local $FileList = _FileListToArray($diretorio, "*.JPG", 1) If Not @error Then $max = $FileList[0] For $i = 1 To $max Step 1 GUICtrlSetData($List, $FileList[$i]) Next GUICtrlSetData($Button4, "Total de Imagens = " & $max) GUICtrlSetData($bar, "Imagem Atual: " & $diretorio & "\" & $FileList[1]) GUICtrlSetImage($Pic1, $diretorio & "\" & $FileList[1]) Else $max = 0 EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func gui($foto = '') GUICtrlSetImage($Pic1, $diretorio & "\" & $FileList[$foto]) GUICtrlSetData($bar, "Imagem Atual: " & $diretorio & "\" & $FileList[$foto]) EndFunc ;==>gui
×