CineShot

« Older   Newer »
  Share  
SyntX
CAT_IMG Posted on 24/2/2011, 22:03     +1   -1




Ecco il programma che usa le hotkey per fare gli screenshot. Adesso ha molti bug e imperfezioni ma non ho più tempo adesso correggerli ed a migliorareil programma.. Faccio domani
Versione:v0.1

SPOILER (click to view)
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.6.1
Author: myName

Script Function:
Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <buttonconstants.au3>
#include <comboconstants.au3>
#include <editconstants.au3>
#include <guiconstantsex.au3>
#include <sliderconstants.au3>
#include <staticconstants.au3>
#include <windowsconstants.au3>
#include <screencapture.au3>
#include <guiconstants.au3>

Global $QualityRead, $Slider1, $Salva_Path, $PathRead, $HotKeyResult, $Combo1, $Pass_Avvio, $Avvio_Aut, $nMsg
Global $AvvioResult = 0
Global $c = 1

If Not FileExists (@ScriptDir&"/Config.ini") Then
IniWrite (@ScriptDir&"/Config.ini", "", "", "")
MsgBox (64, "CineShot", "Il programma è stato avviato per la prima volta. Per iniziare bisogna eseguire alcune impostazioni")
ImpostazioniForm()
Else
StartProgram()
EndIf


Func ImpostazioniForm ()
$Impost_Form = GUICreate("CineShot - Impostazioni", 383, 244, 314, 281)
$Group1 = GUICtrlCreateGroup("Impostazioni Generali", 8, 8, 361, 121)
$Label1 = GUICtrlCreateLabel("Path Salvataggio:", 32, 32, 88, 17)
$Salva_Path = GUICtrlCreateInput("Salva_Path", 128, 28, 145, 21)
$Scegli = GUICtrlCreateButton("...", 288, 24, 27, 25, $WS_GROUP)
$Label2 = GUICtrlCreateLabel("Qualità Shot:", 56, 64, 65, 17)
$Slider1 = GUICtrlCreateSlider(128, 56, 150, 29)
$Label3 = GUICtrlCreateLabel("Hot Key:", 77, 96, 45, 17)
$Combo1 = GUICtrlCreateCombo("Non Selezionato", 128, 92, 145, 25)
GUICtrlSetData(-1, "Ctrl + A|Ctrl + B|Ctrl + C|Ctrl + D|Ctrl + E|Ctrl + 1|Ctrl + 2|Ctrl + 3|Ctrl + 4|Ctrl + Alt + S|Ctrl + Alt + W|Ctrl + Alt + 1")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Opzioni Avvio", 8, 144, 361, 57)
$Avvio_Aut = GUICtrlCreateCheckbox("Avvio Automatico", 32, 168, 105, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Salva = GUICtrlCreateButton("Salva", 256, 208, 113, 33, $WS_GROUP)
$Annulla = GUICtrlCreateButton("Annulla", 8, 208, 107, 33, $WS_GROUP)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUISetState(@SW_HIDE)
Case $Scegli
$Select_Act = FileSelectFolder ("Scegliere la cartella dove saranno salvati gli ScreenShot", "")
GUICtrlSetData ($Salva_Path, $Select_Act)
Case $Salva
CheckQuality ()
IniWrite (@ScriptDir&"/Config.ini", "", "Quality", $QualityRead)
CheckPath ()
IniWrite (@ScriptDir&"/Config.ini", "", "Path", $PathRead)
CheckHotKey ()
IniWrite (@ScriptDir&"/Config.ini", "", "HotKey", $HotKeyResult)
CheckBoot ()
IniWrite (@ScriptDir&"/Config.ini", "", "AvvioAutomatico", $AvvioResult)
GUISetState(@SW_HIDE)
StartProgram ()

EndSwitch
WEnd
EndFunc

Func CheckQuality ()
$QualityRead = GUICtrlRead ($Slider1)
Return $QualityRead
EndFunc

Func CheckPath ()
$PathRead = GUICtrlRead ($Salva_Path)
Return $PathRead
EndFunc

Func CheckHotKey ()
$ComboRead = GUICtrlRead ($Combo1)
If $ComboRead = "Ctrl + A" Then
$HotKeyResult = "^a"
ElseIf $ComboRead = "Ctrl + B" Then
$HotKeyResult = "^b"
ElseIf $ComboRead = "Ctrl + C" Then
$HotKeyResult = "^c"
ElseIf $ComboRead = "Ctrl + D" Then
$HotKeyResult = "^d"
ElseIf $ComboRead = "Ctrl + E" Then
$HotKeyResult = "^e"
ElseIf $ComboRead = "Ctrl + 1" Then
$HotKeyResult = "^1"
ElseIf $ComboRead = "Ctrl + 2" Then
$HotKeyResult = "^2"
ElseIf $ComboRead = "Ctrl + 3" Then
$HotKeyResult = "^3"
ElseIf $ComboRead = "Ctrl + 4" Then
$HotKeyResult = "^4"
ElseIf $ComboRead = "Ctrl + Alt + S" Then
$HotKeyResult = "^!s"
ElseIf $ComboRead = "Ctrl + Alt + W" Then
$HotKeyResult = "^!w"
ElseIf $ComboRead = "Ctrl + Alt + 1" Then
$HotKeyResult = "^!1"
EndIf
Return $HotKeyResult
EndFunc

Func CheckBoot ()
If GUICtrlRead($Avvio_Aut) = 1 Then
$AvvioResult = 1
EndIf
EndFunc

Func StartProgram ()
TrayTip ("CineShot", "Programma Startato!", 5)
Global $HotKey = IniRead (@ScriptDir&"/Config.ini", "", "HotKey", "")
Global $Path = IniRead (@ScriptDir&"/Config.ini", "", "Path", "")
Global $Quality = IniRead (@ScriptDir&"/Config.ini", "", "Quality", "")
Global $Avvio = IniRead (@ScriptDir&"/Config.ini", "", "AvvioAutomatico", "")
HotKeySet ($HotKey, "ScreenGo")

While 1
$nMsg = GUIGetMsg ()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd

EndFunc

Func ScreenGo ()
_ScreenCapture_SetJPGQuality ($Quality)
$Capture = _ScreenCapture_Capture ()
_ScreenCapture_SaveImage ($Path&"/"&$c&".jpg", $Capture)
$c = $c + 1
TrayTip ("CineShot", "Screen Fatto!", 5)
EndFunc


 
Top
xMasteRx
CAT_IMG Posted on 24/2/2011, 22:11     +1   -1




ottimo ;)
comunque metti qualcosa come un Style ONLY_READ sull'input per la patch di salvataggio ^^
e metti qualche hotkey o qualcosa per poter rifare le impostazioni ^^
 
Top
SyntX
CAT_IMG Posted on 24/2/2011, 22:16     +1   -1




ok, provvedo nella 0.2 :)
 
Top
/dev/random
CAT_IMG Posted on 24/2/2011, 22:16     +1   -1




Ok, il CheckHotKey non mi convince molto, uno switch era più elegante.
Attento ai nomi delle variabili e indenta il codice.

Per il resto ok, bravo :D
 
Top
SyntX
CAT_IMG Posted on 24/2/2011, 22:18     +1   -1




EDIT

e credo che tolgo quel jpg e metto che le fa in BMP che vengono meglio, quindi non so con cosa rimpiazzare quella slider per la qualità

CITAZIONE (/dev/random @ 24/2/2011, 22:16) 
Ok, il CheckHotKey non mi convince molto, uno switch era più elegante.
Attento ai nomi delle variabili e indenta il codice.

Per il resto ok, bravo :D

in effetti XD
 
Top
/dev/random
CAT_IMG Posted on 24/2/2011, 22:47     +1   -1




Per le immagini bitmap ci sono 5 livelli di risoluzione, vedi _ScreenCapture_SetBMPFormat().
 
Top
SyntX
CAT_IMG Posted on 27/2/2011, 19:22     +1   -1




QUOTE (/dev/random @ 24/2/2011, 22:47) 
Per le immagini bitmap ci sono 5 livelli di risoluzione, vedi _ScreenCapture_SetBMPFormat().

Ok, grazie
 
Top
6 replies since 24/2/2011, 22:03   177 views
  Share