Function Reference


Allocate an empty encoder parameter list

#include <GDIPlus.au3>
_GDIPlus_ParamInit ( $iCount )


$iCount The total number of $tagGDIPENCODERPARAM that the list can contain

Return Value

Success: a $tagGDIPENCODERPARAMS structure.
Failure: sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPID_ERR*).


In order to pass parameters to any of the encoder functions, you must use an encoder parameter list.
This function is used to allocate an encoder parameter list that can then be passed to _GDIPlus_ParamAdd() to add the actual parameters.




#include <GDIPlus.au3>
#include <ScreenCapture.au3>


Func Example()
    Local $hImage, $sCLSID, $tData, $tParams

    ; Capture screen
    _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image.jpg")

    ; Initialize GDI+ library

    ; Load image
    $hImage = _GDIPlus_ImageLoadFromFile(@MyDocumentsDir & "\GDIPlus_Image.jpg")

    ; Get JPEG encoder CLSID
    $sCLSID = _GDIPlus_EncodersGetCLSID("JPG")

    ; Set up parameters for 90 degree rotation
    $tData = DllStructCreate("int Data")
    DllStructSetData($tData, "Data", $GDIP_EVTTRANSFORMROTATE90)
    $tParams = _GDIPlus_ParamInit(1)
    _GDIPlus_ParamAdd($tParams, $GDIP_EPGTRANSFORMATION, 1, $GDIP_EPTLONG, DllStructGetPtr($tData, "Data"))

    ; Save image with rotation
    _GDIPlus_ImageSaveToFileEx($hImage, @MyDocumentsDir & "\GDIPlus_Image2.jpg", $sCLSID, $tParams)

    ; Shut down GDI+ library

    ShellExecute(@MyDocumentsDir & "\GDIPlus_Image2.jpg")
EndFunc   ;==>Example