Immage Converter, by Eyobi

« Older   Newer »
  Share  
eyobi
icon11  CAT_IMG Posted on 19/8/2009, 14:48     +1   -1




Immage converter

Codice:

SPOILER (click to view)
#include <guiconstants.au3>
#include <gdiplus.au3>
#include <guiconstantsex.au3>
Opt("MustDeclareVars", 1)
Global $sImage,$hImage,$sCLSID,$convert,$info,$Cjpg,$Cbmp,$Cgif,$Cico,$Cpng,$Ctif,$msg,$close,$min

GUICreate("Eyobi image converter",400,400)
GUISetBkColor(0*0)

GUICtrlCreateLabel("3y0b1 immage coverter",40,20,555550,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$close = GUICtrlCreatePic("close.jpg",365,0,35,20)
$min = GUICtrlCreatePic("min2.bmp",329,0,35,20)
GUICtrlCreateLabel("Select an immage to convert:",20,70,165,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$sImage= GUICtrlCreateInput(@desktopdir &"\",20,140,350,20)
GUICtrlCreateLabel("Put the immage you want to convert in your desktop:",20,90,400,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Then write the name of the immage below and the extention:",20,110,400,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$convert = GUICtrlCreateButton("Convert",155,370)
$info = GUICtrlCreateButton("About",0,0)
GUICtrlCreateLabel("What type of file do you want your immage:",15,170,245,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)

GUICtrlCreateIcon("convert.ico",100,150,250,50)
GUICtrlCreateLabel("Convert Into:",145,290,80,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cjpg= GUICtrlCreateRadio("",300,200,15,15)
GUICtrlCreateLabel("JPG",320,200,25,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cbmp = GUICtrlCreateRadio("",300,230,15,15)
GUICtrlCreateLabel("BMP",320,230,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cgif = GUICtrlCreateRadio("",300,260,15,15)
GUICtrlCreateLabel("GIF",320,260,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cico = GUICtrlCreateRadio("",300,290,15,15)
GUICtrlCreateLabel("ICO",320,290,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cpng = GUICtrlCreateRadio("",300,320,15,15)
GUICtrlCreateLabel("PNG",320,320,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Ctif = GUICtrlCreateRadio("",300,350,15,15)
GUICtrlCreateLabel("TIF",320,350,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)

GUISetState()

while 1

$msg = GUIGetMsg()
Switch $msg
Case $info
_info()
case -3
ExitLoop
case $close
ExitLoop
case $min
GUISetState (@SW_MINIMIZE)

case $convert
Global $sImage, $hImage, $sCLSID,$Cjpg
If GUICtrlRead($Cjpg) = $GUI_CHECKED Then
$sImage = InputBox("your file to jpg", "ReEnter file name before proceding Make sure you write the extention:", @DesktopDir & "\", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("jpg")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "\converted.jpg", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Cbmp) = $GUI_CHECKED Then
$sImage = InputBox("your file to bmp", "ReEnter file name before proceding Make sure you write the extention", @DesktopDir & "\", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("bmp")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "\converted.bmp", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Cgif) = $GUI_CHECKED Then
$sImage = InputBox("your file to gif", "ReEnter file name before proceding:", @DesktopDir & "\", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("gif")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "\converted.gif", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Cico) = $GUI_CHECKED Then
$sImage = InputBox("your file to ico", "ReEnter file name before proceding Make sure you write the extention", @DesktopDir & "\", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("ico")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "\converted.ico", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Cpng) = $GUI_CHECKED Then
$sImage = InputBox("your file to png", "ReEnter file name before proceding Make sure you write the extention", @DesktopDir & "\", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("png")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "\converted.png", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Ctif) = $GUI_CHECKED Then
$sImage = InputBox("your file to tif", "ReEnter file name before proceding Make sure you write the extention", @DesktopDir & "\", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("tif")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "\converted.tif", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf


If $msg = $GUI_EVENT_CLOSE Then ExitLoop

EndSwitch
WEnd

func _info()
#include <guiconstants.au3>
GUICreate("Eyob' Immage Converter",400,300)
GUISetBkColor(0*0)
GUICtrlCreatePic("autoit_scripter.jpg",0,0,400,30)
GUICtrlCreateLabel("Immage Converter © 2009",80,40,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Created by: Eyob Ogbai",30,70,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("All Rights Reserved",30,100,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("E-mail: [email protected]",30,130,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Website: www.eyobogbai.wordpress.com",5,160,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Version 1.3",30,190,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Immage Converter © 2009",80,220,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)

GUICtrlCreatePic("autoituserbar2wm6.jpg",0,269,400,30)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
case -3
ExitLoop
EndSwitch
WEnd
GUIDelete()
EndFunc


che ne pensate ?
 
Top
Aaly
CAT_IMG Posted on 27/8/2009, 21:36     +1   -1




Se mi restasse aperto potrei valutare :sese:
 
Top
-Mr.xxxxxxxxxx17-
CAT_IMG Posted on 15/11/2009, 18:43     +1   -1




gią...
 
Top
Darkprince97
CAT_IMG Posted on 24/12/2009, 13:50     +1   -1




SPOILER (click to view)
CODICE
#include <guiconstants.au3>
#include <gdiplus.au3>
#include <guiconstantsex.au3>
Opt("MustDeclareVars", 1)
Global $sImage,$hImage,$sCLSID,$convert,$info,$Cjpg,$Cbmp,$Cgif,$Cico,$Cpng,$Ctif,$msg,$close,$min

GUICreate("Eyobi image converter",400,400)
GUISetBkColor(0*0)

GUICtrlCreateLabel("3y0b1 immage coverter",40,20,555550,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$close = GUICtrlCreatePic("close.jpg",365,0,35,20)
$min = GUICtrlCreatePic("min2.bmp",329,0,35,20)
GUICtrlCreateLabel("Select an immage to convert:",20,70,165,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$sImage= GUICtrlCreateInput(@desktopdir &"",20,140,350,20)
GUICtrlCreateLabel("Put the immage you want to convert in your desktop:",20,90,400,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Then write the name of the immage below and the extention:",20,110,400,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$convert = GUICtrlCreateButton("Convert",155,370)
$info = GUICtrlCreateButton("About",0,0)
GUICtrlCreateLabel("What type of file do you want your immage:",15,170,245,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)

GUICtrlCreateIcon("convert.ico",100,150,250,50)
GUICtrlCreateLabel("Convert Into:",145,290,80,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cjpg= GUICtrlCreateRadio("",300,200,15,15)
GUICtrlCreateLabel("JPG",320,200,25,15)
GUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cbmp = GUICtrlCreateRadio("",300,230,15,15)
GUICtrlCreateLabel("BMP",320,230,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cgif = GUICtrlCreateRadio("",300,260,15,15)
GUICtrlCreateLabel("GIF",320,260,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cico = GUICtrlCreateRadio("",300,290,15,15)
GUICtrlCreateLabel("ICO",320,290,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Cpng = GUICtrlCreateRadio("",300,320,15,15)
GUICtrlCreateLabel("PNG",320,320,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
$Ctif = GUICtrlCreateRadio("",300,350,15,15)
GUICtrlCreateLabel("TIF",320,350,25,15)
gUICtrlSetFont(-1, 9, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
While 1
GUISetState(@SW_SHOW)
WEnd
while 1

$msg = GUIGetMsg()
Switch $msg
Case $info
_info()
case -3
ExitLoop
case $close
ExitLoop
case $min
GUISetState (@SW_MINIMIZE)

case $convert
Global $sImage, $hImage, $sCLSID,$Cjpg
If GUICtrlRead($Cjpg) = $GUI_CHECKED Then
$sImage = InputBox("your file to jpg", "ReEnter file name before proceding Make sure you write the extention:", @DesktopDir & "", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("jpg")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "converted.jpg", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Cbmp) = $GUI_CHECKED Then
$sImage = InputBox("your file to bmp", "ReEnter file name before proceding Make sure you write the extention", @DesktopDir & "", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("bmp")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "converted.bmp", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Cgif) = $GUI_CHECKED Then
$sImage = InputBox("your file to gif", "ReEnter file name before proceding:", @DesktopDir & "", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("gif")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "converted.gif", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Cico) = $GUI_CHECKED Then
$sImage = InputBox("your file to ico", "ReEnter file name before proceding Make sure you write the extention", @DesktopDir & "", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("ico")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "converted.ico", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Cpng) = $GUI_CHECKED Then
$sImage = InputBox("your file to png", "ReEnter file name before proceding Make sure you write the extention", @DesktopDir & "", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("png")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "converted.png", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf
If GUICtrlRead($Ctif) = $GUI_CHECKED Then
$sImage = InputBox("your file to tif", "ReEnter file name before proceding Make sure you write the extention", @DesktopDir & "", "", 200, 130)
if @Error or not FileExists($sImage) then Exit
_GDIPlus_StartUp()
$hImage = _GDIPlus_ImageLoadFromFile($sImage)
$sCLSID = _GDIPlus_EncodersGetCLSID("tif")
_GDIPlus_ImageSaveToFileEx($hImage, @DesktopDir & "converted.tif", $sCLSID)
_GDIPlus_ShutDown()
MsgBox(0,"eyobi", "converted sucsessufly")
EndIf


If $msg = $GUI_EVENT_CLOSE Then ExitLoop

EndSwitch
WEnd

func _info()
#include <guiconstants.au3>
GUICreate("Eyob' Immage Converter",400,300)
GUISetBkColor(0*0)
GUICtrlCreatePic("autoit_scripter.jpg",0,0,400,30)
GUICtrlCreateLabel("Immage Converter © 2009",80,40,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Created by: Eyob Ogbai",30,70,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("All Rights Reserved",30,100,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("E-mail: eyobogbai@yahoo.com",30,130,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Website: www.eyobogbai.wordpress.com",5,160,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Version 1.3",30,190,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)
GUICtrlCreateLabel("Immage Converter © 2009",80,220,50000000,50)
GUICtrlSetFont(-1, 15, 800, 0)
GUICtrlSetColor(-1,0xFFFFFF)

GUICtrlCreatePic("autoituserbar2wm6.jpg",0,269,400,30)
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
case -3
ExitLoop
EndSwitch
WEnd
GUIDelete()
EndFunc


Questo dovrebbe workare ,provatelo cosi
Ho solo aggiunto un ciclo while nel quale ho messo lo stato della GUI su show :)
 
Top
3 replies since 19/8/2009, 14:37   312 views
  Share