asmazh Posted July 29, 2011 Share Posted July 29, 2011 (edited) Buyrun arkadaşlar dün yazdım. Bu aralar canım çok sıkılıyor ve havada sıcak üffffff Değerlendirmelerinizi bekliyorum! (Maksat bu bölüm canlansın) [code]#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=gif.ico #AutoIt3Wrapper_Res_Comment=SB - Image Converter 1.0 #AutoIt3Wrapper_Res_Description=SB - Image Converter 1.0 #AutoIt3Wrapper_Res_Fileversion=1.0.0.0 #AutoIt3Wrapper_Res_LegalCopyright=Mahmut TAŞKIRAN (c) 2011 #AutoIt3Wrapper_Res_Language=1055 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** TraySetIcon("Gif.ico") Opt("TrayMenuMode", 1) #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GDIplus.au3> #include <ScreenCapture.au3> #include <Constants.au3> HotKeySet("{F10}", "_ScreenCapture") $Tray_Hakk = TrayCreateItem("Hakkında") TrayCreateItem("") $Tray_Capture = TrayCreateItem("Ekran Yakala (F10)") $Tray_P_Hide = TrayCreateItem("Programı Gizle/Göster") TrayCreateItem("") $Tray_P_EXIT = TrayCreateItem("Programı Kapat") $Reg_File = RegRead("HKLM\SOFTWARE\Microsoft\SB - ImageCon", "File") $Reg_Format = RegRead("HKLM\SOFTWARE\Microsoft\SB - ImageCon", "Format") If $Reg_Format <> "jpg" And $Reg_Format <> "jpeg" And $Reg_Format <> "gif" And $Reg_Format <> "bmp" And $Reg_Format <> "png" Then RegWrite("HKLM\SOFTWARE\Microsoft\SB - ImageCon", "Format", "REG_SZ", "jpg") EndIf If $Reg_File = "" Then RegWrite("HKLM\SOFTWARE\Microsoft\SB - ImageCon", "File", "REG_SZ", @MyDocumentsDir) EndIf $ConvertGui = GUICreate("SB - Image Converter 1.0", 443, 160, -1, -1) GUISetIcon("gif.ico") $TabL1 = GUICtrlCreateTab(5, 4, 433, 121, BitOR($TCS_MULTISELECT, $TCS_FLATBUTTONS, $TCS_TOOLTIPS)) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("Format Değiş") $Button_Convert = GUICtrlCreateButton("Değiştir !", 4, 128, 83, 25, $WS_GROUP) GUICtrlSetState(-1, $GUI_SHOW) $Label3 = GUICtrlCreateLabel("Resim Seç :", 10, 37, 72, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Input_ImageSelect = GUICtrlCreateInput("", 88, 34, 241, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY)) $Button_Select_Image = GUICtrlCreateButton("Gözat", 336, 33, 43, 22, $WS_GROUP) $Button_Open_Image = GUICtrlCreateButton("Aç", 384, 33, 45, 22, $WS_GROUP) GUICtrlCreateLabel("Kaydet :", 10, 63, 51, 17) GUICtrlSetFont(-1, 6, 800, 0, "MS Sans Serif") $Input_Image_Save = GUICtrlCreateInput("", 88, 60, 241, 21, BitOR($ES_AUTOHSCROLL, $ES_READONLY)) $Button_Save_Image = GUICtrlCreateButton("Gözat", 336, 59, 43, 22, $WS_GROUP) GUICtrlCreateLabel("Format :", 10, 92, 50, 17) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Combo_Image_Format = GUICtrlCreateCombo("", 88, 88, 241, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "jpg|JPEG|GIF|BMP|PNG|ICO|TIF") $TabL2 = GUICtrlCreateTabItem("Ekran Yakala") $Button_capture = GUICtrlCreateButton("Ekran Yakala (F10)", 4, 128, 100, 25, $WS_GROUP) $Group1 = GUICtrlCreateGroup("Kaydedilecek yer - Dosya uzantısı", 13, 30, 417, 89) $Input_Image_Name_Save = GUICtrlCreateInput($Reg_File, 24, 51, 361, 21) $Combo_IS_Format = GUICtrlCreateCombo(StringUpper($Reg_Format), 24, 85, 361, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "JPEG|GIF|BMP|PNG") $ButtonSaveImage = GUICtrlCreateButton("...", 392, 50, 25, 21, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateTabItem("") $Button_Hakk = GUICtrlCreateButton("Hakkında", 285, 130, 75, 25, $WS_GROUP) $Button_Exit = GUICtrlCreateButton("Çıkış", 363, 130, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) Global $P = False While 1 $Tray = TrayGetMsg() $nMsg = GUIGetMsg() Switch $nMsg Case -3 Exit Case $Button_Exit Exit Case $Button_Select_Image $_Select_Image = FileOpenDialog("Resim Seç", "", "Image (*.jpg;*.gif;*.bmp;*.png;*.ico;*.jpeg)", 1, "", $ConvertGui) GUICtrlSetData($Input_ImageSelect, $_Select_Image) Case $Button_Save_Image $_Save_Image_Save = FileSelectFolder("Resmi Kaydetmek İstediğiniz Klasörü Seçiniz!", "", 1 + 2 + 4, "", $ConvertGui) GUICtrlSetData($Input_Image_Save, $_Save_Image_Save) Case $Button_Open_Image If GUICtrlRead($Input_ImageSelect) <> "" Then ShellExecute(GUICtrlRead($Input_ImageSelect)) Else MsgBox(16, "Hata", "Lütfen dosya seç! ") EndIf Case $Button_Convert _Image_Convert() Case $ButtonSaveImage $_Save_Image_Save2 = FileSelectFolder("Resmi Kaydetmek İstediğiniz Klasörü Seçiniz!", "", 1 + 2 + 4, "", $ConvertGui) GUICtrlSetData($Input_Image_Name_Save, $_Save_Image_Save2) RegWrite("HKLM\SOFTWARE\Microsoft\SB - ImageCon", "File", "REG_SZ", $_Save_Image_Save2) Case $Button_capture RegWrite("HKLM\SOFTWARE\Microsoft\SB - ImageCon", "Format", "REG_SZ", StringLower(GUICtrlRead($Combo_IS_Format))) _ScreenCapture() Case $Button_Hakk MsgBox(64, "Hakkında", "Bu program Mahmut TAŞKIRAN tarafından www.tnctr.com sitesi için yazılmıştır!" & @CRLF & "Programın kullanışı çok basittir. Öyle uzun uzadıya açıklama yapmayı gereksiz buldum." & @CRLF & "Taskiran_Mahmut[b][color=#FF0000]Forumda msn, mail, adres, gerçek isim vs. bilgilerinizi paylaşmayınız[/color][/b].com", 0, $ConvertGui) EndSwitch Select Case $Tray = $Tray_Hakk TrayItemSetState($Tray_Hakk, $TRAY_UNCHECKED) MsgBox(64, "Hakkında", "Bu program Mahmut TAŞKIRAN tarafından www.tnctr.com sitesi için yazılmıştır!" & @CRLF & "Programın kullanışı çok basittir. Öyle uzun uzadıya açıklama yapmayı gereksiz buldum." & @CRLF & "Taskiran_Mahmut[b][color=#FF0000]Forumda msn, mail, adres, gerçek isim vs. bilgilerinizi paylaşmayınız[/color][/b].com", 0, $ConvertGui) Case $Tray = $Tray_P_EXIT TrayItemSetState($Tray_P_EXIT, $TRAY_UNCHECKED) Exit Case $Tray = $Tray_Capture TrayItemSetState($Tray_Capture, $TRAY_UNCHECKED) _ScreenCapture() Case $Tray = $Tray_P_Hide TrayItemSetState($Tray_P_Hide, $TRAY_UNCHECKED) If $P = False Then GUISetState(@SW_HIDE, $ConvertGui) $P = True ElseIf $P = True Then GUISetState(@SW_SHOW, $ConvertGui) WinSetState($ConvertGui, "", @SW_RESTORE) $P = False ElseIf $P <> False And $P <> True Then $P = True EndIf EndSelect WEnd Func _Image_Convert() If GUICtrlRead($Input_ImageSelect) <> "" Then Global $NOT = "İşlem Tamamlandı!" & @CRLF & GUICtrlRead($Input_ImageSelect) & @CRLF & "Dosyasının Uzantısı Değiştirildi: " & "*." & StringLower(GUICtrlRead($Combo_Image_Format)) _GDIPlus_Startup() $image = _GDIPlus_ImageLoadFromFile(GUICtrlRead($Input_ImageSelect)) $t = _GDIPlus_EncodersGetCLSID(GUICtrlRead($Combo_Image_Format)) _GDIPlus_ImageSaveToFileEx($image, _Select_Item(), $t) _GDIPlus_Shutdown() If Not @error Then MsgBox(64, "Tamamlandı...", $NOT) EndIf Else MsgBox(16, "Hata", "Bu işlemi gerçekleştirmek için herhangi bir dosya seçiniz ve" & @CRLF & "uzantısını belirleyiniz!") EndIf EndFunc ;==>_Image_Convert Func _ScreenCapture() If GUICtrlRead($Combo_IS_Format) <> "" And GUICtrlRead($Input_Image_Name_Save) <> "" Then $Random = Random(1, 999, 2) WinSetState($ConvertGui, "", @SW_MINIMIZE) Sleep(2000) _GDIPlus_Startup() ; Capture screen If FileExists(GUICtrlRead($Input_Image_Name_Save) & '\' & "SB - " & $Random & "." & GUICtrlRead($Combo_IS_Format)) Then $Random = Random(0,999,3) ; her ihtimale karşı. Kullanıcının daha önce aldığı bir resim randomun kurbanı olmasın! EndIf $hBitmap = _ScreenCapture_Capture(GUICtrlRead($Input_Image_Name_Save) & '\' & "SB - " & $Random & "." & GUICtrlRead($Combo_IS_Format)) _GDIPlus_Shutdown() If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(36, "Tamamlandı...", "İşlem Tamamlandı!" & @CRLF & GUICtrlRead($Input_Image_Name_Save) & '\' & "SB - " & $Random & "." & StringLower(GUICtrlRead($Combo_IS_Format)) & @CRLF & "Dosyayı açmak istiyormusun?") Select Case $iMsgBoxAnswer = 6 ;Yes Run("MSPaint.exe " & '"' & GUICtrlRead($Input_Image_Name_Save) & '\' & "SB - " & $Random & "." & StringLower(GUICtrlRead($Combo_IS_Format))) Case $iMsgBoxAnswer = 7 ;No WinSetState($ConvertGui, "", @SW_RESTORE) EndSelect WinSetState($ConvertGui, "", @SW_RESTORE) Else MsgBox(16, "Hata", "Dosyayı kaydetmek için bir yer belirleyin ve uzantısını seçin!") GUISetState($ConvertGui, @SW_SHOW) WinSetState($ConvertGui, "", @SW_RESTORE) GUICtrlSetState($TabL2, $GUI_SHOW) EndIf EndFunc ;==>_ScreenCapture Func _Select_Item() $StringTINST = StringTrimLeft(GUICtrlRead($Input_ImageSelect), StringInStr(GUICtrlRead($Input_ImageSelect), "\", 0, -1)) $result = StringRight($StringTINST, 3) If $result = "peg" Then $result = StringTrimRight($StringTINST, 5) Else $result = StringTrimRight($StringTINST, 4) EndIf If GUICtrlRead($Input_Image_Save) <> "" Then $ImageAndFormat = GUICtrlRead($Input_Image_Save) & "\" & $result & "." & StringLower(GUICtrlRead($Combo_Image_Format)) ElseIf GUICtrlRead($Input_Image_Save) = "" Then $StringTINST = StringLeft(GUICtrlRead($Input_ImageSelect), StringInStr(GUICtrlRead($Input_ImageSelect), "\", 0, -1)) DirCreate($StringTINST & "Orjinal Hali") $ImageAndFormat = $StringTINST & $result & "." & StringLower(GUICtrlRead($Combo_Image_Format)) Global $FileDelete_Select_Image = 1 EndIf Return $ImageAndFormat EndFunc ;==>_Select_Item[/code] Edited July 29, 2011 by asmazh Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.