Home COM GDI+ WebBrowser Data Access 

ImageAttributes Functions (GDI+)

 

 

An ImageAttributes object contains information about how bitmap and metafile colors are manipulated during rendering. An ImageAttributes object maintains several color-adjustment settings, including color-adjustment matrices, grayscale-adjustment matrices, gamma-correction values, color-map tables, and color-threshold values.

 

Return Values

If the function succeeds, it returns Ok, which is an element of the Status enumeration.

 

If the function fails, it returns one of the other elements of the Status enumeration.

 

GdipCloneImageAttributes

 

Description

Makes a copy of this ImageAttributes object.

Syntax

GpStatus WINGDIPAPI GdipCloneImageAttributes(

    GDIPCONST GpImageAttributes *imageattr,

    GpImageAttributes **cloneImageattr

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCloneImageAttributes ( _

    BYVAL imageattr AS DWORD, _

    BYREF cloneImageattr AS DWORD _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

cloneImageattr

[out] Pointer to a variable that receives a pointer to the new ImageAttributes object.

 

GdipCreateImageAttributes

 

Description

Creates an ImageAttributes object.

Syntax

GpStatus WINGDIPAPI GdipCreateImageAttributes(

    GpImageAttributes **imageattr

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCreateImageAttributes ( _

    BYREF imageattr AS DWORD _

) AS LONG

Parameters

 

imageattr

[out] Pointer to a variable that receives a pointer to the new created ImageAttributes object.

 

GdipDisposeImageAttributes

 

Description

Disposes the specified ImageAttributes object.

Syntax

GpStatus WINGDIPAPI GdipDisposeImageAttributes(

    GpImageAttributes *imageattr

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDisposeImageAttributes ( _

    BYVAL imageattr AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object to dispose.

 

GdipGetImageAttributesAdjustedPalette

 

Description

Adjusts the colors in a palette according to the adjustment settings of a specified category.

Syntax

GpStatus WINGDIPAPI GdipGetImageAttributesAdjustedPalette(

    GpImageAttributes *imageAttr,

    ColorPalette * colorPalette,

    ColorAdjustType colorAdjustType

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageAttributesAdjustedPalette ( _

    BYVAL imageattr AS DWORD, _

    BYREF palette AS ColorPalette, _

    BYVAL colorAdjustType AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

palette

[in, out] Pointer to a ColorPalette structure that on input, contains the palette to be adjusted and, on output, receives the adjusted palette.

colorAdjustType

[in] Element of the ColorAdjustType enumeration that specifies the category whose adjustment settings will be applied to the palette.

 

GdipResetImageAttributes

 

Description

Adjusts the colors in a palette according to the adjustment settings of a specified category.

Syntax

GpStatus WINGDIPAPI GdipResetImageAttributes(

    GpImageAttributes *imageattr,

    ColorAdjustType type

);

PowerBASIC Syntax

DECLARE FUNCTION GdipResetImageAttributes ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which color adjustment is reset. The default value is ColorAdjustTypeDefault.

Return Value

If the function succeeds, it returns Ok, which is an element of the Status enumeration.

 

If the function fails, it returns one of the other elements of the Status enumeration.

 

GdipSetImageAttributesCachedBackground

 

Description

Sets or clears the CachedBackground member of a specified GpImageAttributes object. Microsoft Windows GDI+ does not use the CachedBackground member, so calling this function has no effect. The imageattr parameter specifies the GpImageAttributes object. The enableFlag parameter specifies whether the CachedBackground member is set (TRUE) or cleared (FALSE).

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesCachedBackground(

    GpImageAttributes *imageattr,

    BOOL enableFlag

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesCachedBackground ( _

    BYVAL imageattr AS DWORD, _

    BYVAL enableFlag AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

enableFlag

[in] Boolean value that specifies whether the CachedBackground member is set (TRUE) or cleared (FALSE)

 

GdipSetImageAttributesColorKeys

 

Description

Sets the color key (transparency range) for a specified category.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesColorKeys(

    GpImageAttributes *imageattr,

    ColorAdjustType type,

    BOOL enableFlag,

    ARGB colorLow,

    ARGB colorHigh

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesColorKeys ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG, _

    BYVAL enableFlag AS LONG, _

    BYVAL colorLow AS DWORD, _

    BYVAL colorHigh AS DWORD _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which the color key is set. The default value is ColorAdjustTypeDefault.

enableFlag

[in] Boolean value that specifies whether a separate transparency range is enabled for the category specified by the type parameter.

colorLow

[in] ARGB color that specifies the low color-key value.

colorHigh

[in] ARGB color that specifies the high color-key value.

 

GdipSetImageAttributesColorMatrix

 

Description

Sets the color-adjustment matrix for a specified category.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesColorMatrix(

    GpImageAttributes *imageattr,

    ColorAdjustType type,

    BOOL enableFlag,

    GDIPCONST ColorMatrix* colorMatrix,

    GDIPCONST ColorMatrix* grayMatrix,

    ColorMatrixFlags flags

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesColorMatrix ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG, _

    BYVAL enableFlag AS LONG, _

    BYREF colourMatrix AS ColorMatrix, _

    BYREF grayMatrix AS ColorMatrix, _

    BYVAL flags AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which the color-adjustment matrix is set. The default value is ColorAdjustTypeDefault.

enableFlag

[in] Boolean value that specifies whether a separate color adjustment is enabled for the category specified by the type parameter.

colourMatrix

[in] Pointer to a 55 color-adjustment matrix.

grayMatrix

[in] Specifies a matrix to be used for adjusting gray shades when the value of the flags parameter is ColorMatrixFlagsAltGray.

flag

[in] Element of the ColorMatrixFlags enumeration that specifies the type of image and color that will be affected by the color-adjustment matrix.

 

GdipSetImageAttributesGamma

 

Description

Sets the gamma value for a specified category.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesGamma(

    GpImageAttributes *imageattr,

    ColorAdjustType type,

    BOOL enableFlag,

    REAL gamma

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesGamma ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG, _

    BYVAL enableFlag AS LONG, _

    BYVAL gamma AS SINGLE _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which the gamma value is set. The default value is ColorAdjustTypeDefault.

enableFlag

[in] Boolean value that specifies whether a separate gamma is enabled for the category specified by the type parameter.

gamma

[in] Single precision value number that specifies the gamma value.

 

GdipSetImageAttributesICMMode

 

Description

This function sets an internal state variable to the value specified by the on parameter.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesICMMode(

    GpImageAttributes *imageAttr,

    BOOL on

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesICMMode ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pOn AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

on

[in] If this value is true, Image Color Management (ICM) is used for all color adjustment. If the value is false, ICM is not used.

 

GdipSetImageAttributesNoOp

 

Description

Turns off color adjustment for a specified category.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesNoOp(

    GpImageAttributes *imageattr,

    ColorAdjustType type,

    BOOL enableFlag

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesNoOp ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG, _

    BYVAL enableFlag AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which color correction is turned off. The default value is ColorAdjustTypeDefault.

enableFlag

[in] Boolean value that specifies whether a color adjustment is enabled for the category specified by the type parameter.

 

GdipSetImageAttributesOutputChannel

 

Description

Sets the CMYK output channel for a specified category.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannel(

    GpImageAttributes *imageattr,

    ColorAdjustType type,

    BOOL enableFlag,

    ColorChannelFlags channelFlags

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesOutputChannel ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG, _

    BYVAL enableFlag AS LONG, _

    BYVAL channelFlags AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which the output channel is set. The default value is ColorAdjustTypeDefault.

enableFlag

[in]  Boolean value that specifies whether a separate output channel is enabled for the category specified by the type parameter.

channelFlags

[in] Element of the ColorChannelFlags enumeration that specifies the output channel.

 

GdipSetImageAttributesOutputChannelColorProfile

 

Description

Sets the output channel color-profile file for a specified category.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesOutputChannelColorProfile(

    GpImageAttributes *imageattr,

    ColorAdjustType type,

    BOOL enableFlag,

    GDIPCONST WCHAR *colorProfileFilename

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesOutputChannelColorProfile ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG, _

    BYVAL enableFlag AS LONG, _

    BYVAL colorProfileFilename AS STRING _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which the output channel color-profile file is set. The default value is ColorAdjustTypeDefault.

enableFlag

[in]  Boolean value that specifies whether a separate output channel color profile is enabled for the category specified by the type parameter.

colorProfileName

[in] Path name of a color-profile file. If the color-profile file is in the %SystemRoot%\System32\Spool\Drivers\Color directory, then this parameter can be the file name. Otherwise, this parameter must be the fully-qualified path name.

 

GdipSetImageAttributesRemapTable

 

Description

Sets the color-remap table for a specified category.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesRemapTable(

    GpImageAttributes *imageattr,

    ColorAdjustType type,

    BOOL enableFlag,

    UINT mapSize,

    GDIPCONST ColorMap *map

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesRemapTable ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG, _

    BYVAL enableFlag AS LONG, _

    BYVAL mapSize AS DWORD, _

    BYREF map AS ColorMap _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which the color-remap table is set. The default value is ColorAdjustTypeDefault.

enableFlag

[in]  Boolean value that specifies whether a separate color remap table is enabled for the category specified by the type parameter.

mapSize

[in] Long integer value that specifies the number of elements in the map array.

map

[in] Pointer to an array of ColorMap structures that defines the color map.

 

GdipSetImageAttributesThreshold

 

Description

Sets the threshold (transparency range) for a specified category.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(

    GpImageAttributes *imageattr,

    ColorAdjustType type,

    BOOL enableFlag,

    REAL threshold

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesThreshold ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG, _

    BYVAL enableFlag AS LONG, _

    BYVAL threshold AS SINGLE _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which the color threshold is set. The default value is ColorAdjustTypeDefault.

enableFlag

[in]  Boolean value that specifies whether a separate threshold is enabled for the category specified by the type parameter.

threshold

[in] Single precision value number that specifies the threshold value.

 

GdipSetImageAttributesToIdentity

 

Description

Sets the color-adjustment matrix of a specified category to identity matrix.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesToIdentity(

    GpImageAttributes *imageattr,

    ColorAdjustType type

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesToIdentity ( _

    BYVAL imageattr AS DWORD, _

    BYVAL pType AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

type

[in] Element of the ColorAdjustType enumeration that specifies the category for which the color-adjustment matrix is set to identity. The default value is ColorAdjustTypeDefault.

 

GdipSetImageAttributesWrapMode

 

Description

Sets the wrap mode of this ImageAttributes object.

Syntax

GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(

    GpImageAttributes *imageAttr,

    WrapMode wrap,

    ARGB argb,

    BOOL clamp

);

PowerBASIC Syntax

DECLARE FUNCTION GdipSetImageAttributesWrapMode ( _

    BYVAL imageattr AS DWORD, _

    BYVAL wrap AS LONG, _

    BYVAL pColor AS DWORD, _

    BYVAL clamp AS LONG _

) AS LONG

Parameters

 

imageattr

[in] Pointer to the ImageAttributes object.

wrap

[in] Element of the WrapMode enumeration that specifies how repeated copies of an image are used to tile an area.

argb

[in] ARGB color object that specifies the color of pixels outside of a rendered image. This color is visible if the wrap parameter is set to WrapModeClamp and the source rectangle passed to GdipDrawImage is larger than the image itself.

clamp

[in] This parameter has no effect in Microsoft Windows GDI+ version 1.0. Set this parameter to FALSE.

 

Page last updated on Monday, 11 December 2006 11:02:10 +0100