wolkenloser Posted March 27, 2006 Posted March 27, 2006 Hi I want to resize JPG to an more compressed format by using a DLLCALL. But it don´t works I will use janGraphics.dll from [url=http://www.vb script: $s_File1 = "C:\ProfilCopy.jpg" $s_File2 = "C:\ProfilCopy2.jpg" $s_fixWidth = 0 $s_fixHeight = 0 $s_TransparentGif = "False" $s_JpegQuality = 50 ;~ _Picture_save($s_File1, $s_File2,$s_fixWidth, $s_fixHeight,$s_TransparentGif,$s_JpegQuality) _Picture_save($s_File1, $s_File2) ;~ Func _Picture_save($s_File1, $s_File2, $s_fixWidth, $s_fixHeight,$s_TransparentGif,$s_JpegQuality) Func _Picture_save($s_File1, $s_File2) ;~ $dllcall = DllCall("janGraphics.dll", 'long',"ConvertEx", 'str', $s_File1 , 'str', $s_File2 , 'str', $s_fixWidth , 'long', $s_fixHeight , 'long', $s_TransparentGif , 'long', $s_JpegQuality , 'long') $dllcall = DllCall("janGraphics.dll", "str", "ConvertEx", "str", $s_File1 , "str", $s_File2 ) If @error Then MsgBox(4096,"FEHLER","Es ist ein Fehler aufgetreten") SetError(1) Return 0 Else Return 1 EndIf EndFunc It ´doesn´t work at this Moment, but I dont knew the reason for that. Can you help me ? regards Wolke
Moderators SmOke_N Posted March 27, 2006 Moderators Posted March 27, 2006 Generally people that need help with a non-standard dll will provide either a link to get it or the dll itself? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
wolkenloser Posted March 28, 2006 Author Posted March 28, 2006 janGraphics.dll seems to be a COM dll... needs regsvr32'd and Beta AutoIt and ObjCreate... you may need to study more... Lar.I've found the right way in the german forum (http://www.autoit.de) I have modified it, so now ist running how I like it thanks wolke opt("TrayIconDebug", 1) FileInstall('C:\picture_convert\jangraphics.dll',@TempDir & "\") $sDll = @TempDir & '\jangraphics.dll' $nFixWidth = 0 $nFixHeight = 0 $bTransparentGif = FALSE $nJpegQuality = 25 $counter = $CMDLINE[0]$nJpegQuality=InputBox("Qualitätseinstellung","Bitte die Qualitätseinstellung festlegen (1-100%)","25") $suffix=InputBox("Dateibenennung","Bitte geben sie einen Text an der an den Dateinamen angehängt wird." & @CR & "Ein leeres Feld überschreibt die Originaldateien","_small") RunWait(@Comspec & ' /c ' & @SystemDir & '\regsvr32 /s ' & $sDll, '', @SW_HIDE) For $i = 1 To $counter convert(); The Function within Next RunWait(@Comspec & ' /c ' & @SystemDir & '\regsvr32 /s /u ' & $sDll, '', @SW_HIDE) FileDelete(@TempDir & "\jangraphics.dll") Func convert() $sInFile = $CMDLINE[$i] $sOutfile = StringTrimRight($CMDLINE[$i], 4) & $suffix & ".jpg" ;~ MsgBox(0,"aktuelles Bild",$CMDLINE[$i]) $obj = ObjCreate('janGraphics.Compendium') ; Einfache Konvertierung ;$obj.convert($sInFile, $sOutfile) ; Komplexe Konvertierung $message= $obj.convertEx($sInFile, $sOutfile, $nFixWidth, $nFixHeight, $bTransparentGif, $nJpegQuality) $obj = 0 ToolTip("Konvertierung im Gange - Bild" & $i & " von " & $CMDLINE[0] & @CR & "Speichere unter ->" & $sOutfile) If Not $message = 0 Then MsgBox(0,$CMDLINE[$i],$message) EndFunc
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