slightly_abnormal Posted May 19, 2006 Share Posted May 19, 2006 (edited) Hi there.. I'm trying to get autoit go through images, in order, and then I can go back images by pressing back, I tried it with arrays.. I don't know whats next, so i just did it the way i know..heres the image.. it should be different colors for 1 through 5.. i uploaded it as bmp but imageshack made it a png image..http://img148.imageshack.us/img148/6692/1image2dw.png#include <GUIConstants.au3> $Form1 = GUICreate("NextImage", 414, 305, 246, 194) ;~ Dim $Pick[5] ;~ $Pick[1]= GUICtrlCreatePic(@ScriptDir&"\1image.bmp", 8, 8, 393, 233) ;~ $Pick[2]= GUICtrlCreatePic(@ScriptDir&"\2image.bmp", 8, 8, 393, 233) ;~ $Pick[3]= GUICtrlCreatePic(@ScriptDir&"\3image.bmp", 8, 8, 393, 233) ;~ $Pick[3]= GUICtrlCreatePic(@ScriptDir&"\4image.bmp", 8, 8, 393, 233) $Pick = GUICtrlCreatePic(@ScriptDir&"\1image.bmp", 8, 8, 393, 233) $Back= GUICtrlCreateButton("Back", 160, 256, 97, 41) $Next = GUICtrlCreateButton("Next", 264, 256, 97, 41) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Back GUICtrlCreatePic("1image.bmp", 8, 8, 393, 233) GUICtrlCreatePic("2image.bmp", 8, 8, 393, 233) GUICtrlCreatePic("3image.bmp", 8, 8, 393, 233) Case $msg = $Next GUICtrlCreatePic("2image.bmp", 8, 8, 393, 233) GUICtrlCreatePic("3image.bmp", 8, 8, 393, 233) GUICtrlCreatePic("4image.bmp", 8, 8, 393, 233) Case Else EndSelect WEnd Exit Edited May 19, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
Valuater Posted May 19, 2006 Share Posted May 19, 2006 (edited) 1make sure you fix this...;~ $Pick[2]= GUICtrlCreatePic(@ScriptDir&"\2image.bmp", 8, 8, 393, 233);~ $Pick[3]= GUICtrlCreatePic(@ScriptDir&"\3image.bmp", 8, 8, 393, 233);~ $Pick[3]= GUICtrlCreatePic(@ScriptDir&"\4image.bmp", 8, 8, 393, 233)2use guictrlsetsate( control id, $GUI_HIDE)... and $GUI_SHOW in the loop8) Edited May 19, 2006 by Valuater Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 19, 2006 Author Share Posted May 19, 2006 I dont know what i'm doing #include <GUIConstants.au3> $Form1 = GUICreate("NextImage", 414, 305, 246, 194) Dim $Pick[5] $Pick[1]= GUICtrlCreatePic(@ScriptDir&"\1image.bmp", 8, 8, 393, 233) $Pick[2]= GUICtrlCreatePic(@ScriptDir&"\2image.bmp", 8, 8, 393, 233) $Pick[3]= GUICtrlCreatePic(@ScriptDir&"\3image.bmp", 8, 8, 393, 233) $Pick[4]= GUICtrlCreatePic(@ScriptDir&"\4image.bmp", 8, 8, 393, 233) $Pic = $Pick[1] $Back= GUICtrlCreateButton("Back", 160, 256, 97, 41) $Next = GUICtrlCreateButton("Next", 264, 256, 97, 41) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Back Guictrlsetstate($Pic,$Pick[1] -1) Case $msg = $Next Guictrlsetstate($Pic,$Pick[1] +1) Case Else EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 19, 2006 Author Share Posted May 19, 2006 (edited) Now it does the same thing? expandcollapse popup#include <GUIConstants.au3> $Form1 = GUICreate("NextImage", 414, 305, 246, 194) ;~ Dim $Pick[5] ;~ $Pick[1]= GUICtrlCreatePic(@ScriptDir&"\1image.bmp", 8, 8, 393, 233) ;~ $Pick[2]= GUICtrlCreatePic(@ScriptDir&"\2image.bmp", 8, 8, 393, 233) ;~ $Pick[3]= GUICtrlCreatePic(@ScriptDir&"\3image.bmp", 8, 8, 393, 233) ;~ $Pick[4]= GUICtrlCreatePic(@ScriptDir&"\4image.bmp", 8, 8, 393, 233) $Pic = GUICtrlCreatePic(@ScriptDir&"\1image.bmp", 8, 8, 393, 233) $Back= GUICtrlCreateButton("Back", 160, 256, 97, 41) $Next = GUICtrlCreateButton("Next", 264, 256, 97, 41) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Back GUICtrlSetState($Pic, $GUI_HIDE) GUICtrlCreatePic(@ScriptDir&"\1image.bmp", 8, 8, 393, 233) GUICtrlSetState($Pic, $GUI_SHOW) GUICtrlSetState($Pic, $GUI_HIDE) GUICtrlCreatePic(@ScriptDir&"\2image.bmp", 8, 8, 393, 233) GUICtrlSetState($Pic, $GUI_SHOW) GUICtrlSetState($Pic, $GUI_HIDE) GUICtrlCreatePic(@ScriptDir&"\3image.bmp", 8, 8, 393, 233) GUICtrlSetState($Pic, $GUI_SHOW) Case $msg = $Next GUICtrlSetState($Pic, $GUI_HIDE) GUICtrlCreatePic(@ScriptDir&"\2image.bmp", 8, 8, 393, 233) GUICtrlSetState($Pic, $GUI_SHOW) GUICtrlSetState($Pic, $GUI_HIDE) GUICtrlCreatePic(@ScriptDir&"\3image.bmp", 8, 8, 393, 233) GUICtrlSetState($Pic, $GUI_SHOW) GUICtrlSetState($Pic, $GUI_HIDE) GUICtrlCreatePic(@ScriptDir&"\4image.bmp", 8, 8, 393, 233) GUICtrlSetState($Pic, $GUI_SHOW) Case Else EndSelect WEnd Exit Edited May 19, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 19, 2006 Author Share Posted May 19, 2006 eh.. help? Link to comment Share on other sites More sharing options...
Valuater Posted May 20, 2006 Share Posted May 20, 2006 (edited) eh.. help? ok... try this.......... EDIT - TESTED OK!!! expandcollapse popup#include <GUIConstants.au3> Dim $Pick[5], $pics = 4 $Form1 = GUICreate("NextImage", 414, 305, 246, 194) $Pick[1]= GUICtrlCreatePic(@ScriptDir&"\1image.bmp", 8, 8, 393, 233) $Pick[2]= GUICtrlCreatePic(@ScriptDir&"\2image.bmp", 8, 8, 393, 233) GUICtrlSetState( -1, $GUI_HIDE) $Pick[3]= GUICtrlCreatePic(@ScriptDir&"\3image.bmp", 8, 8, 393, 233) GUICtrlSetState( -1, $GUI_HIDE) $Pick[4]= GUICtrlCreatePic(@ScriptDir&"\4image.bmp", 8, 8, 393, 233) GUICtrlSetState( -1, $GUI_HIDE) $notice = GUICtrlCreateLabel("Picture #1", 20, 258, 100, 30) GUICtrlSetFont( -1, 15, 700) $Back= GUICtrlCreateButton("Back", 160, 256, 97, 41) $Next = GUICtrlCreateButton("Next", 264, 256, 97, 41) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Back $set = -1 get_pic($set) Case $msg = $Next $set = 1 get_pic($set) Case Else EndSelect WEnd Exit Func get_pic($t) For $x = 1 to $pics $State = GUICtrlGetState($pick[$x]) If $State = 80 Then If $x = 1 And $t = -1 Then Return If $x = $pics And $t = 1 Then Return Guictrlsetstate($Pick[$x], $GUI_HIDE) Guictrlsetstate($Pick[$x + $set], $GUI_SHOW) GUICtrlSetData($notice, "Picture #" & $x + $set) Return EndIf Next EndFunc 8) Edited May 20, 2006 by Valuater Link to comment Share on other sites More sharing options...
Valuater Posted May 20, 2006 Share Posted May 20, 2006 (edited) all pics in a folder expandcollapse popup;********* USER INPUT ************** $Location = @ScriptDir & "\" $Type = "*.bmp" ; bmp, jpg ...whatever you want ;*********************************** #include <GUIConstants.au3> #Include <File.au3> $FileList=_FileListToArray($Location, $Type, 1) If (Not IsArray($FileList)) Or (@Error=1) Then MsgBox (0,"Sorry!","No Pictures Found. ", 3) Exit EndIf $num = UBound($FileList) -1 Dim $Pick[$num + 1] $Form1 = GUICreate("NextImage", 414, 305, 246, 194) $Pick[1]= GUICtrlCreatePic($Location&$FileList[1], 8, 8, 393, 233) for $x = 2 to $num $Pick[$x]= GUICtrlCreatePic($Location&$FileList[$x], 8, 8, 393, 233) GUICtrlSetState( -1, $GUI_HIDE) Next $notice = GUICtrlCreateLabel("Picture #1", 20, 258, 130, 30) GUICtrlSetFont( -1, 15, 700) $Back= GUICtrlCreateButton("Back", 160, 256, 97, 41) $Next = GUICtrlCreateButton("Next", 264, 256, 97, 41) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Back $set = -1 get_pic($set) Case $msg = $Next $set = 1 get_pic($set) Case Else EndSelect WEnd Exit Func get_pic($t) For $x = 1 to $num $State = GUICtrlGetState($pick[$x]) If $State = 80 Then If $x = 1 And $t = -1 Then Return If $x = $num And $t = 1 Then Return Guictrlsetstate($Pick[$x], $GUI_HIDE) Guictrlsetstate($Pick[$x + $set], $GUI_SHOW) GUICtrlSetData($notice, "Picture #" & $x + $set) Return EndIf Next EndFunc 8) Edited May 20, 2006 by Valuater Link to comment Share on other sites More sharing options...
slightly_abnormal Posted May 20, 2006 Author Share Posted May 20, 2006 Awesome! thanks val! Link to comment Share on other sites More sharing options...
Valuater Posted May 20, 2006 Share Posted May 20, 2006 Awesome! thanks val! Welcome8) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now