↑  ←  Описание функции


_GDIPlus_ParamAdd

Add a value to an encoder parameter list

#include <GDIPlus.au3>
_GDIPlus_ParamAdd(ByRef $tParams, $sGUID, $iCount, $iType, $pValues)

Параметры

$tParams Структура $tagGDIPPENCODERPARAMS возвращённая функцией _GDIPlus_ParamInit
$sGUID Encoder parameter GUID. Can be one of the following:
    $GDIP_EPGCHROMINANCETABLE - Chrominance table settings
    $GDIP_EPGCOLORDEPTH - Color depth settings
    $GDIP_EPGCOMPRESSION - Compression settings
    $GDIP_EPGLUMINANCETABLE - Luminance table settings
    $GDIP_EPGQUALITY - Quality settings
    $GDIP_EPGRENDERMETHOD - Render method settings
    $GDIP_EPGSAVEFLAG - Save flag settings
    $GDIP_EPGSCANMETHOD - Scan mode settings
    $GDIP_EPGTRANSFORMATION - Transformation settings
    $GDIP_EPGVERSION - Software version settings
$iCount Количество элементов в массиве $pValues
$iType Encoder parameter value type. Can be one of the following:
    $GDIP_EPTBYTE - 8 bit unsigned integer
    $GDIP_EPTASCII - Null terminated character string
    $GDIP_EPTSHORT - 16 bit unsigned integer
    $GDIP_EPTLONG - 32 bit unsigned integer
    $GDIP_EPTRATIONAL - Two longs (numerator, denominator)
    $GDIP_EPTLONGRANGE - Two longs (low, high)
    $GDIP_EPTUNDEFINED - Array of bytes of any type
    $GDIP_EPTRATIONALRANGE - Two longs (low, high)
$pValues Pointer to an array of values. Each value has the type specified by the $iType data member.

См. также

_GDIPlus_ParamInit, $tagGDIPPENCODERPARAMS

Пример

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

_Main()

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

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

    ; Инициализация библиотеки GDI+
    _GDIPlus_Startup ()

    ; 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, DllStructGetPtr($tParams))

    ; Закрывает библиотеку GDI+
    _GDIPlus_ShutDown ()

EndFunc   ;==>_Main