bartekd Posted June 9, 2011 Share Posted June 9, 2011 Did you figure it out? It saves to c:\Screenshots\ First it creates the directory if it doesn't exist. If it does exist, then it just saves to that folder. Hmm with the code below, It is telling me that it is saving, but I cant find the file. Where exactly is the function/command to save the file? expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=camera2.ico #AutoIt3Wrapper_UseUpx=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** $h_DllCaptDLL = DllOpen("captdll.dll");Open it only once at the beginning and close it once at the end. Not every time the while loops. FileCopy(@ScriptDir & "\captdll.dll","C:\windows\system32\captdll.dll",1) ;~ #NoTrayIcon $Count = 0 ;=========================================================================================C Drive DirCreate("C:\Screenshots\") Global $FileName = ("C:\Screenshots\"& @MON & "-" & @MDAY & "-" & @YEAR & "--" & @HOUR & @MIN & "-" &@ComputerName & "-" & @UserName) For $count1 = 0 to 30 If FileExists($FileName & "-" & $Count1 & ".jpeg") Then $count = $Count+1 EndIf Next $msg = "" $msg2 = "Local C Drive " $Window = "IZArc" ;Executes the fuctions created below.Print_Window() Print_Window () OnAutoItExit() Terminate () ;Function that prints the screen Func Print_Window () $Size = WinGetPos($Window) DllCall($h_DllCaptDLL, "int:cdecl", "CaptureRegion", "str", $FileName & "-" & $Count & ".jpeg", "int", $Size[0], "int", $Size[1], "int", $Size[2], "int", $Size[3], "int", 1000) EndFunc ;Fucntion that exists Func Terminate () Exit EndFunc ;Fuction that closes the dll file after the above function closes the sctipt Func OnAutoItExit() DllClose($h_DllCaptDLL);closing the dll now that the script is exiting. TrayTip ( $msg & " Screenshot Taken","Screenshot saved to " & $msg2 & @CRLF& @CRLF & @MON & "-" & @MDAY & "-" & @YEAR & "--" & @HOUR & @MIN & "-" &@ComputerName & "-" & @UserName & "-" & $Count & ".jpeg", 1 ) sleep(3500) ;~ MsgBox(1,$msg & " Screenshot Taken","Screenshot saved to " & $msg2 & @CRLF& @CRLF & @MON & "-" & @MDAY & "-" & @YEAR & "--" & @HOUR & @MIN & "-" &@ComputerName & "-" & @UserName & "-" & $Count & ".jpeg",15) EndFunc Link to comment Share on other sites More sharing options...
richietheprogrammer Posted June 9, 2011 Author Share Posted June 9, 2011 Yes I got it to work thanks . My question now is, when i use GUICtrlCreatePic, Is it possible to display more than one photo inside one GUI? Any ideas? Link to comment Share on other sites More sharing options...
BrewManNH Posted June 9, 2011 Share Posted June 9, 2011 Just make the picture smaller than the GUI size and set their positions and sizes appropriately. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
richietheprogrammer Posted June 9, 2011 Author Share Posted June 9, 2011 Just make the picture smaller than the GUI size and set their positions and sizes appropriately. Yes this is what I want to do, I know how to set the picture size smaller than the GUI size, but how can I display more than one picture in the GUI? Thanks for your help! GUICreate("My GUI picture", 1200, 500, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; will create a dialog box that when displayed is centered GUISetBkColor(0xE0FFFF) $n = GUICtrlCreatePic($path & "\" & $FileArray[$i], 0, 0, 40, 200) GUISetState() Next ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd Link to comment Share on other sites More sharing options...
BrewManNH Posted June 9, 2011 Share Posted June 9, 2011 Use more than one GUICtrlCreatePic command would be the simple answer to that question. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
richietheprogrammer Posted June 9, 2011 Author Share Posted June 9, 2011 Use more than one GUICtrlCreatePic command would be the simple answer to that question.That doesnt work for me. I dont want 60 GUI's to open if I have 60 pictures. I want one GUI to open that has all 60. Anyway I can do that? Link to comment Share on other sites More sharing options...
BrewManNH Posted June 9, 2011 Share Posted June 9, 2011 Read my last answer, think about what that command does (read the help file if you're not sure), and then go from there. Here's a hint, it has nothing to do with multiple GUIs, just multiple Pics on a GUI. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
richietheprogrammer Posted June 9, 2011 Author Share Posted June 9, 2011 (edited) Read my last answer, think about what that command does (read the help file if you're not sure), and then go from there. Here's a hint, it has nothing to do with multiple GUIs, just multiple Pics on a GUI. I understand, but its not working. The code: For $i = 1 To $FileArray[0] ;GUI to display all images in folder GUICreate("My GUI picture", 1200, 500, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; will create a dialog box that when displayed is centered GUISetBkColor(0xE0FFFF) $n = GUICtrlCreatePic($path & "\" & $FileArray[$i], 0, 0, 1200, 500) $n = GUICtrlCreatePic($path & "\" & $FileArray[$i], 1200, 500, 1200, 500) GUISetState() Next opens 2 seperate GUIs Edited June 9, 2011 by richietheprogrammer Link to comment Share on other sites More sharing options...
UEZ Posted June 9, 2011 Share Posted June 9, 2011 Have a look to a simple slide show I made: Maybe you can take some parts for your needs. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
BrewManNH Posted June 10, 2011 Share Posted June 10, 2011 It opens 2 GUIs because you create the GUI inside the For...Next loop, GUICreate should be outside the loop and the GUICtrlCreatePic should be inside it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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