Jump to content

Assign parameters to GIF


Go to solution Solved by UEZ,

Recommended Posts

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 by JScript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

  • Moderators

JScript,

You have been here long enough to know that we frown on bumping your own threads within 24 hours. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Solution

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

@Melba23

Yes, you're right, sorry for that!

@UEZ

Thanks 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

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...