Jump to content

Search the Community

Showing results for tags 'pictures viewer'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I wrote this because windows 8 picture viewer does not support animated gifs. It's a really basic script as i code as an hobbist. Any useful comments welcome ;simple image viewer by Zentral #include <GuiconstantsEx.au3> #include <_GUIResourcePic.au3> #include <WindowsConstants.au3> #include <FileListToArray.au3> #include <Misc.au3> If UBound(ProcessList(@ScriptName)) > 2 Then MsgBox(4096, "Error", @ScriptName&" is already running.", 5) Exit EndIf $gui=GUICreate("Simple Image Viewer",800,650, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SIZEBOX), $WS_EX_ACCEPTFILES) $picture=_GUICtrlPic_Create('', 5, 5) Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) Opt("GUIOnEventMode", 1) Opt("MouseCoordMode", 2) GUISetOnEvent($GUI_EVENT_CLOSE, '_exit') GUISetOnEvent($GUI_EVENT_MINIMIZE, '_mintray') GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_movepic') $open = TrayCreateItem("Open Folder") TrayItemSetOnEvent(-1,"_folder") TrayCreateItem("") $open = TrayCreateItem("Set Recusion") TrayItemSetOnEvent(-1,"_setrec") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayItemSetOnEvent(-1,"_about") $restoreitem = TrayCreateItem("Restore") TrayItemSetOnEvent(-1,"RestoreTray") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1,"_exit") TraySetToolTip("Simple Image Viewer") GUISetState(@SW_SHOW) Global $picture, $files = '', $recursion = 0, $currentpos = 1 While 1 sleep(50) ;~ left arrow If _IsPressed('25') Then _previous() While _IsPressed("25") Sleep(10) WEnd EndIf ;~ up arrow If _IsPressed('26') Then _first() While _IsPressed("26") Sleep(10) WEnd EndIf ;~ right arrow If _IsPressed('27') Then _next() While _IsPressed("27") Sleep(10) WEnd EndIf ;~ down arrow If _IsPressed('28') Then _last() While _IsPressed("28") Sleep(10) WEnd EndIf WEnd Func _movepic() $cInfo = GUIGetCursorInfo($gui) ; Is it over a control $iControl = $cInfo[4] Switch $iControl ; If it is a control we want to move Case $picture ; Work out offset of mouse on control $aPos = ControlGetPos($gui, "", $iControl) $iSubtractX = $cInfo[0] - $aPos[0] $iSubtractY = $cInfo[1] - $aPos[1] ; And then move the control until the mouse button is released Do $cInfo = GUIGetCursorInfo($gui) ControlMove($gui, "", $iControl, $cInfo[0] - $iSubtractX, $cInfo[1] - $iSubtractY) Until Not $cInfo[2] EndSwitch EndFunc Func _folder() _GUICtrlPic_Delete($picture) $files=_RecFileListToArray(InputBox('','Path:'),'*.jpg;*.png;*.gif;*.bmp',1,$recursion,0,2) $currentpos = 1 $picture=_GUICtrlPic_Create($files[$currentpos], 5, 5) EndFunc Func _next() If $files = '' Then _folder() $currentpos+=1 If $currentpos > $files[0] then $currentpos=1 _GUICtrlPic_Delete($picture) $picture=_GUICtrlPic_Create($files[$currentpos], 5, 5) EndFunc Func _previous() If $files = '' Then _folder() $currentpos-=1 If $currentpos < 1 then $currentpos=$files[0] _GUICtrlPic_Delete($picture) $picture=_GUICtrlPic_Create($files[$currentpos], 5, 5) EndFunc Func _last() If $files = '' Then _folder() $currentpos=$files[0] _GUICtrlPic_Delete($picture) $picture=_GUICtrlPic_Create($files[$currentpos], 5, 5) EndFunc Func _first() If $files = '' Then _folder() $currentpos=1 _GUICtrlPic_Delete($picture) $picture=_GUICtrlPic_Create($files[$currentpos], 5, 5) EndFunc Func _setrec() $recusion=InputBox('','Set recursion:'&@CRLF&@CRLF&'1 - Search in all subfolders (unlimited recursion)'&@CRLF&'0 - Do not search in subfolders (Default)'&@CRLF&'Negative integer - Search in subfolders to specified depth','0','',400) EndFunc Func _MinTray() GuiSetState(@SW_HIDE) TraySetState(1) EndFunc Func RestoreTray() GuiSetState(@SW_SHOW) GuiSetState(@SW_RESTORE) TraySetState(2) EndFunc Func _about() MsgBox(0,"Author: Zentral","Function: simple image viewer."&@CRLF&'Navigate with arrows') EndFunc Func _exit() Exit 1 EndFunc Thanks to João Carlos (jscript) and Melba23 for includes.
×
×
  • Create New...