JScript Posted May 28, 2014 Posted May 28, 2014 (edited) Hello everybody!I have a question regarding the parameters of a GIF.I know the code below sets the quality parameter to JPG, but how to proceed in case of a GIF? Configure quality, colors? $tParams = _GDIPlus_ParamInit(1) $tQlt = DllStructCreate("int Quality") DllStructSetData($tQlt, "Quality", $iQuality) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, DllStructGetPtr($tQlt))Thanks in advance,JS Edited May 28, 2014 by JScript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
JScript Posted May 28, 2014 Author Posted May 28, 2014 Just to remind...JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
Moderators Melba23 Posted May 28, 2014 Moderators Posted May 28, 2014 JScript,You have been here long enough to know that we frown on bumping your own threads within 24 hours. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Solution UEZ Posted May 28, 2014 Solution Posted May 28, 2014 That's not possibe to set the quality of a GIF image this way. As you might know GIF images are always 8-bit (256 color) images. That means you have to create a 8-bit image. Currently I'm writing a GIFAnim UDF and this is a function from the UDF: ; #FUNCTION# ==================================================================================================================== ; Name ..........: _GDIPlus_BitmapConvertTo8Bit ; Description ...: Converts a bitmap to a 8-bit image ; Syntax ........: _GDIPlus_BitmapConvertTo8Bit(Byref $hBitmap[, $iDitherType = $GDIP_DitherTypeDualSpiral8x8[, $iPaletteType = $GDIP_PaletteTypeFixedHalftone252 [, ; $iColorCount = 253]]]) ; Parameters ....: $hBitmap - A handle to an image / bitmap object ; $iDitherType - [optional] An integer value. Default is $GDIP_DitherTypeDualSpiral8x8. -> http://msdn.microsoft.com/en-us/library/ms534106(v=vs.85).aspx ; $iPaletteType - [optional] An integer value. Default is $GDIP_PaletteTypeFixedHalftone252 . -> http://msdn.microsoft.com/en-us/library/ms534159(v=vs.85).aspx ; $iColorCount - [optional] An integer value. Default is 253. ; $bUseTransparentColor - [optional] A binary value. Default is True. ; Return values .: True or False on errors ; Author ........: UEZ ; Modified ......: ; Remarks .......: Vista or a higher operating system is required ; Related .......: _GDIPlus_PaletteInitialize _GDIPlus_BitmapConvertFormat _GDIPlus_ImageLoadFromFile _GDIPlus_BitmapCreateFromScan0 ; Link ..........: http://msdn.microsoft.com/en-us/library/windows/desktop/ms534106(v=vs.85).aspx) ; =============================================================================================================================== Func _GDIPlus_BitmapConvertTo8Bit(ByRef $hBitmap, $iDitherType = $GDIP_DitherTypeDualSpiral8x8, $iPaletteType = $GDIP_PaletteTypeFixedHalftone252, $iColorCount = 253, $bUseTransparentColor = True) Local $tPalette = _GDIPlus_PaletteInitialize($iColorCount, $iPaletteType, 0, $bUseTransparentColor, $hBitmap) Local $iRet = _GDIPlus_BitmapConvertFormat($hBitmap, $GDIP_PXF08INDEXED, $iDitherType, $iPaletteType, $tPalette) Return SetError(@error, @extended, $iRet) EndFunc ;==>_GDIPlus_BitmapConvertTo8Bit Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
JScript Posted May 28, 2014 Author Posted May 28, 2014 @Melba23Yes, you're right, sorry for that!@UEZThanks buddy, I'll do some tests with your UDF.Edit:The following post solved my problem:Thank you very much!JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
UEZ Posted May 28, 2014 Posted May 28, 2014 The stuff from the link you posted is now integrated to the GDIPlus.au3 UDF. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
JScript Posted May 28, 2014 Author Posted May 28, 2014 @UEZYes I know, but unfortunately I have to stick with the version 3.3.8.1 because it has no problem with TCPRecv function and other things ...JS http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
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