Home COM GDI+ WebBrowser Data Access 

Image Functions (GDI+)

 

 

The Image functions allow loading and saving raster images (bitmaps) and vector images (metafiles). An Image object encapsulates a bitmap or a metafile and stores attributes that you can retrieve by calling various Get functions. You can construct Image objects from a variety of file types including BMP, ICON, GIF, JPEG, Exif, PNG, TIFF, WMF, and EMF.

 

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.

 

GdipCloneImage

 

Description

Creates a new Image object and initializes it with the contents of this Image object.

Syntax

GpStatus WINGDIPAPI GdipCloneImage(

    GpImage *image,

    GpImage **cloneImage

);

PowerBASIC Syntax

DECLARE FUNCTION GdipCloneImage ( _

    BYVAL pImage AS DWORD, _

    BYREF cloneImage AS DWORD _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

cloneImage

[in] Pointer to a variab le that receives a pointer to the new Image object.

 

GdipConvertToEmfPlus

 

Syntax

GpStatus WINGDIPAPI GdipConvertToEmfPlus(

    const GpGraphics* refGraphics,

    GpMetafile* metafile,

    BOOL* conversionSuccess,

    EmfType emfType,

    const WCHAR* description,

    GpMetafile** out_metafile

);

Note  Doesn't exist in the export list of the GDIPLUS.DLL. Maybe it isn't still implemented.

 

 

GdipConvertToEmfPlusToFile

 

Syntax

GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile(

    const GpGraphics* refGraphics,

    GpMetafile* metafile,

    BOOL* conversionSuccess,

    const WCHAR* filename,

    EmfType emfType,

    const WCHAR* description,

    GpMetafile** out_metafile

);

Note  Doesn't exist in the export list of the GDIPLUS.DLL. Maybe it isn't still implemented.

 

 

GdipConvertToEmfPlusToStream

 

Syntax

GpStatus WINGDIPAPI GdipConvertToEmfPlusToStream(

    const GpGraphics* refGraphics,

    GpMetafile* metafile,

    BOOL* conversionSuccess,

    IStream* stream,

    EmfType emfType,

    const WCHAR* description,

    GpMetafile** out_metafile

);

Note  Doesn't exist in the export list of the GDIPLUS.DLL. Maybe it isn't still implemented.

 

 

GdipDisposeImage

 

Description

Disposes the specified Image object.

Syntax

GpStatus WINGDIPAPI GdipDisposeImage(

    GpImage *image

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDisposeImage ( _

    BYVAL pImage AS DWORD _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object to dispose.

 

GdipFindFirstImageItem

 

Syntax

GpStatus WINGDIPAPI GdipFindFirstImageItem(

    GpImage *image,

    ImageItemData* item

);

Note  Doesn't exist in the export list of the GDIPLUS.DLL. Maybe it isn't still implemented.

 

 

GdipFindNExtImageItem

 

Syntax

GpStatus WINGDIPAPI GdipFindNextImageItem(

    GpImage *image,

    ImageItemData* item

);

Note  Doesn't exist in the export list of the GDIPLUS.DLL. Maybe it isn't still implemented.

 

 

GdipGetAllPropertyItems

 

Description

Disposes the specified Image object.

Syntax

GpStatus WINGDIPAPI GdipGetAllPropertyItems(

    GpImage *image,

    UINT totalBufferSize,

    UINT numProperties,

    PropertyItem* allItems

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetAllPropertyItems ( _

    BYVAL pImage AS DWORD, _

    BYVAL totalBufferSize AS DWORD, _

    BYVAL numProperties AS DWORD, _

    BYREF allItems AS PropertyItem _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

totalBufferSize

[in] Long integer value that specifies the size, in bytes, of the allItems buffer. Call the GdipGetPropertySize method to obtain the required size.

numProperties

[in] Long integer value that specifies the number of properties in the image. Call the GdipGetPropertySize method to obtain this number.

allItems

[out] Pointer to an array of PropertyItem structures that receive the property items.

 

GdipEncoderParameterList

 

Description

Gets a list of the parameters supported by a specified image encoder.

Syntax

GpStatus WINGDIPAPI GdipGetEncoderParameterList(

    GpImage *image,

    GDIPCONST CLSID* clsidEncoder,

    UINT size,

    EncoderParameters* buffer

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetEncoderParameterList ( _

    BYVAL pImage AS DWORD, _

    BYREF clsidEncoder AS GUID, _

    BYVAL psize AS DWORD, _

    BYREF buffer AS EncoderParameters _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

clsidEncoder

[in] Pointer to a CLSID that specifies the encoder.

size

[in] Integer that specifies the size, in bytes, of the buffer array. Call the GdipGetEncoderParameterListSize method to obtain the required size.

buffer

[out] Pointer to an EncoderParameters structure that receives the list of supported parameters.

 

GdipGetEncoderParameterListSize

 

Description

Gets the size, in bytes, of the parameter list for a specified image encoder.

Syntax

GpStatus WINGDIPAPI GdipGetEncoderParameterListSize(

    GpImage *image,

    GDIPCONST CLSID* clsidEncoder,

    UINT* size

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetEncoderParameterListSize ( _

    BYVAL pImage AS DWORD, _

    BYREF clsidEncoder AS GUID, _

    BYREF psize AS DWORD _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

clsidEncoder

[in] Pointer to a CLSID that specifies the encoder.

size

[in] Pointer to a variable that receives the size, in bytes, of the parameter list.

 

GdipGetImageBounds

 

Description

Gets the bounding rectangle for this image.

Syntax

GpStatus WINGDIPAPI GdipGetImageBounds(

    GpImage *image,

    GpRectF *srcRect,

    GpUnit *srcUnit

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageBounds ( _

    BYVAL pImage AS DWORD, _

    BYREF srcRect AS RectF, _

    BYREF srcUnit AS LONG _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

srcRect

[out] Pointer to a RectF object that receives the bounding rectangle.

srcUnit

[out] Pointer to a variable that receives an element of the Unit enumeration that indicates the unit of measure for the bounding rectangle.

 

GdipGetImageDimension

 

Description

Gets the width and height of this image.

Syntax

GpStatus WINGDIPAPI GdipGetImageDimension(

    GpImage *image,

    REAL *width,

    REAL *height

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageDimension ( _

    BYVAL pImage AS DWORD, _

    BYREF nWidth AS SINGLE, _

    BYREF nHeight AS SINGLE _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

width

[out] Pointer to a variable thatr eceives the width of this image.

height

[out] Pointer to a variable that receives the height of this image.

 

GdipGetImageFlags

 

Description

Gets a set of flags that indicate certain attributes of this Image object.

Syntax

GpStatus WINGDIPAPI GdipGetImageFlags(

    GpImage *image,

    UINT *flags

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageFlags ( _

    BYVAL pImage AS DWORD, _

    BYREF flags AS DWORD _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

flags

[out] Pointer to a variable that receives a value that holds a set of single-bit flags. The flags are defined in the ImageFlags enumeration.

 

GdipGetImageGraphicsContext

 

Description

Creates a Graphics object that is associated with an Image object.

Syntax

GpStatus WINGDIPAPI GdipGetImageGraphicsContext(

    GpImage *image,

    GpGraphics **graphics

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageGraphicsContext ( _

    BYVAL pImage AS DWORD, _

    BYREF graphics AS DWORD _

) AS LONG

Parameters

 

image

[in] Pointer to an Image object that will be associated with the new Graphics object.

graphics

[out] Pointer to a vafriable that receives a pointer to the new Graphics object.

 

GdipGetImageHeight

 

Description

Gets the image height, in pixels, of this image.

Syntax

GpStatus WINGDIPAPI GdipGetImageHeight(

    GpImage *image,

    UINT *height

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageHeight ( _

    BYVAL pImage AS DWORD, _

    BYREF nHeight AS DWORD _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

height

[out] Pointer to a variable that receives the height, in pixels, of this image.

 

GdipGetImageHorizontalResolution

 

Description

Gets the horizontal resolution, in dots per inch, of this image.

Syntax

GpStatus WINGDIPAPI GdipGetImageHorizontalResolution(

    GpImage *image,

    REAL *resolution

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageHorizontalResolution ( _

    BYVAL pImage AS DWORD, _

    BYREF resolution AS SINGLE _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

resolution

[out] Pointer to a variable that receives the horizontal resolution, in dots per inch, of this image.

 

GdipGetImageItemData

 

Syntax

GpStatus WINGDIPAPI GdipGetImageItemData(

    GpImage *image,

    ImageItemData* item

);

Note  Doesn't exist in the export list of the GDIPLUS.DLL. Maybe it isn't still implemented.

 

 

GdipGetImagePalette

 

Description

Gets the color palette of this Image object.

Syntax

GpStatus WINGDIPAPI GdipGetImagePalette(

    GpImage *image,

    ColorPalette *palette,

    INT size

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImagePalette ( _

    BYVAL pImage AS DWORD, _

    BYREF palette AS ColorPalette, _

    BYVAL psize AS LONG _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

palette

[out] Pointer to a ColorPalette structure that receives the palette.

size

[in] Long integer value that specifies the size, in bytes, of the palette. Call the GdipGetPaletteSize method to determine the size.

 

GdipGetImagePaletteSize

 

Description

Gets the size, in bytes, of the color palette of this Image object.

Syntax

GpStatus WINGDIPAPI GdipGetImagePaletteSize(

    GpImage *image,

    INT *size

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImagePaletteSize ( _

    BYVAL pImage AS DWORD, _

    BYREF psize AS LONG _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

size

[out] Pointer to a variable that receives the size, in bytes, of the color palette of this Image object.

 

GdipGetImagePixelFormat

 

Description

Gets the pixel format of this Image object.

Syntax

GpStatus WINGDIPAPI GdipGetImagePixelFormat(

    GpImage *image,

    PixelFormat *format

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImagePixelFormat ( _

    BYVAL pImage AS DWORD, _

    BYREF pFormat AS LONG _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

size

[in] Poingter to a variable thatg receives the size, in bytes, of the color palette of this Image object.

 

GdipGetImageRawFormat

 

Description

Gets a globally unique identifier (GUID) that identifies the format of the image.

Syntax

GpStatus WINGDIPAPI GdipGetImageRawFormat(

    GpImage *image,

    GUID *format

)

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageRawFormat ( _

    BYVAL pImage AS DWORD, _

    BYREF pFormat AS GUID _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

format

[out] Pointer to a GUID variable that receives the format identifier.

 

GdipGetImageThumbnail

 

Description

Gets a thumbnail image from this Image object.

Syntax

GpStatus WINGDIPAPI GdipGetImageThumbnail(

    GpImage *image,

    UINT thumbWidth,

    UINT thumbHeight,

    GpImage **thumbImage,

    GetThumbnailImageAbort callback,

    VOID * callbackData

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageThumbnail ( _

    BYVAL pImage AS DWORD, _

    BYVAL thumbWidth AS DWORD, _

    BYVAL thumbHeight AS DWORD, _

    BYREF thumbImage AS DWORD, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

thumbWidth

[in] Width, in pixels, of the requested thumbnail image.

thumbHeight

[in] Height, in pixels, of the requested thumbnail image.

thumbImage

[out] Pointer to an Image object that contains the thumbnail image.

callback

[in] Callback function that you provide. During the process of creating or retrieving the thumbnail image, Microsoft Windows GDI+ calls this function to give you the opportunity to abort the process. The default value is NULL.

callbackData

[in] Pointer to a block of memory that contains data to be used by the callback function. The default value is NULL.

 

GdipGetImageType

 

Description

Gets the type (bitmap or metafile) of this Image object.

Syntax

GpStatus WINGDIPAPI GdipGetImageType(

    GpImage *image,

    ImageType *type

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageType ( _

    BYVAL pImage AS DWORD, _

    BYREF pType AS LONG _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

type

[out] Pointer to a variable that receives an element of the ImageType enumeration that indicates the image type.

 

GdipGetImageVerticalResolution

 

Description

Gets the vertical resolution, in dots per inch, of this image.

Syntax

GpStatus WINGDIPAPI GdipGetImageVerticalResolution(

    GpImage *image,

    REAL *resolution

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageVerticalResolution ( _

    BYVAL pImage AS DWORD, _

    BYREF resolution AS SINGLE _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

resolution

[out] Pointer to a variable thatg receives the vertical resolution, in dots per inch, of this image.

 

GdipGetImageWidth

 

Description

Gets the width, in pixels, of this image.

Syntax

GpStatus WINGDIPAPI GdipGetImageWidth(

    GpImage *image,

    UINT *width

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetImageWidth ( _

    BYVAL pImage AS DWORD, _

    BYREF nWidth AS DWORD _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

width

[out] Pointer to a variable that receives the width, in pixels, of this image.

 

GdipGetPropertyCount

 

Description

Gets the number of properties (pieces of metadata) stored in this Image object.

Syntax

GpStatus WINGDIPAPI GdipGetPropertyCount(

    GpImage *image,

    UINT* numOfProperty

);

PowerBASIC Syntax

DECLARE FUNCTION GdipGetPropertyCount ( _

    BYVAL pImage AS DWORD, _

    BYREF numOfProperty AS DWORD _

) AS LONG

Parameters

 

image

[in] Pointer to the Image object.

numOfProperty

[out] Pointer to a variable that receives the number of properties stored in this Image object.

 

GdipGetPropertyIdList

 

Description

Gets a list of the property identifiers used in the metadata of this Image object.

Syntax

GpStatus WINGDIPAPI GdipGetPropertyIdList(

    GpImage *image,

    UINT numOfProperty,

    PROPID* list

);

PowerBASIC Syntax