Matteo Posted November 22, 2007 Posted November 22, 2007 Hi, i've a problem (i think this topic is alredy exist,but i don't find it),so:can i convert a image PNG to a BMP?please help me. ,.-~*´¨¯¨`*·~-.¸-(_[M]¦¦[A]¦¦[T]¦¦[T]¦ ¦[E]¦¦[O]_)-,.-~*´¨¯¨`*·~-.¸
Zedna Posted November 22, 2007 Posted November 22, 2007 Search for GDI+ It's in Auto3Library or in latest beta UDF. Resources UDF ResourcesEx UDF AutoIt Forum Search
smashly Posted November 23, 2007 Posted November 23, 2007 (edited) Example as Zedna said using AutoIt (beta) v3.2.9.14#Include <GDIPlus.au3> _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(@SystemDir & "\DirectX\Dinput\act_rs.png") $sCLSID = _GDIPlus_EncodersGetCLSID("BMP") _GDIPlus_ImageSaveToFileEx($hImage, @ScriptDir & "\act_rs.bmp", $sCLSID) _GDIPlus_ShutDown() Cheers Edit: Changed output from jpg to bmp. Edited November 23, 2007 by smashly
Matteo Posted November 23, 2007 Author Posted November 23, 2007 I try it, but it say: C:\Programmi\AutoIt3\Include\GDIPlus.au3 (2026) : ==> Subscript used with non-Array variable.: Return SetError($aResult[0], 0, $aResult[2]) Return SetError($aResult^ ERROR ->15:02:22 AutoIT3.exe ended.rc:1 +>15:02:23 AutoIt3Wrapper Finished >Exit code: 1 Time: 17.064 ,.-~*´¨¯¨`*·~-.¸-(_[M]¦¦[A]¦¦[T]¦¦[T]¦ ¦[E]¦¦[O]_)-,.-~*´¨¯¨`*·~-.¸
Zedna Posted November 23, 2007 Posted November 23, 2007 I try it, but it say: C:\Programmi\AutoIt3\Include\GDIPlus.au3 (2026) : ==> Subscript used with non-Array variable.: Return SetError($aResult[0], 0, $aResult[2]) Return SetError($aResult^ ERROR ->15:02:22 AutoIT3.exe ended.rc:1 +>15:02:23 AutoIt3Wrapper Finished >Exit code: 1 Time: 17.064 Use latest beta. It works fine with 3.2.9.14 on my WINXP Resources UDF ResourcesEx UDF AutoIt Forum Search
martin Posted November 24, 2007 Posted November 24, 2007 Use latest beta. It works fine with 3.2.9.14 on my WINXP I think yo are wrong Zedna. See this example of one of the functions in GDIPlus.au3 Func _GDIPlus_ImageLoadFromFile($sFileName) Local $aResult $aResult = DllCall($ghGDIPDll, "int", "GdipLoadImageFromFile", "wstr", $sFileName, "int*", 0) Return SetError($aResult[0], 0, $aResult[2]) EndFunc ;==>_GDIPlus_ImageLoadFromFile If there is an error in a dllcall then @error is set to 1 or 2 or 3 and the return result is not an array as assumed. I think the functions need to be corrected. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Zedna Posted November 25, 2007 Posted November 25, 2007 (edited) I think yo are wrong Zedna. See this example of one of the functions in GDIPlus.au3 Func _GDIPlus_ImageLoadFromFile($sFileName) Local $aResult $aResult = DllCall($ghGDIPDll, "int", "GdipLoadImageFromFile", "wstr", $sFileName, "int*", 0) Return SetError($aResult[0], 0, $aResult[2]) EndFunc ;==>_GDIPlus_ImageLoadFromFile If there is an error in a dllcall then @error is set to 1 or 2 or 3 and the return result is not an array as assumed. I think the functions need to be corrected. You are right. There is weak error checking. But it should work OK as it is if no error occurs - for example not existing image or not installed GDI+ on WIN9x EDIT: now I tested it also on my WIN98 and it works OK too Edited November 25, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Greenhorn Posted November 25, 2007 Posted November 25, 2007 Hi, i've a problem (i think this topic is alredy exist,but i don't find it),so:can i convert a image PNG to a BMP?please help me.Do you wanna do it with AutoIt or just generally how to convert a PNG to BMP !?GreetzGreenhorn
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