Home COM GDI+ WebBrowser Data Access 

Graphics Functions (GDI+)

 

 

The Graphics functions provide methods for drawing lines, curves, figures, images, and text. A Graphics object stores attributes of the display device and attributes of the items to be drawn.

 

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.

 

GdipEndContainer

 

Description

Closes a graphics container that was previously opened by the GdipBeginContainer method.

Syntax

GpStatus WINGDIPAPI GdipEndContainer(

    GpGraphics *graphics,

    GraphicsContainer state

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEndContainer ( _

    BYVAL graphics AS DWORD, _

    BYVAL pState AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

state

[in] Value (previously returned by GdipBeginContainer) that identifies the container to be closed.

Remarks

When you call the GdipBeginContainer function, an information block that holds the state of the Graphics object is put on a stack. The GdipBeginContainer method returns a value that identifies that information block. When you pass the identifying value to the GdipEndContainer method, the information block is removed from the stack and is used to restore the Graphics object to the state it was in at the time of the GdipBeginContainer call.

 

Containers can be nested; that is, you can call the GdipBeginContainer function several times before you call the GdipEndContainer function. Each time you call the GdipBeginContainer function, an information block is put on the stack, and you receive an identifier for the information block. When you pass one of those identifiers to the GdipEndContainer function, the Graphics object is returned to the state it was in at the time of the GdipBeginContainer call that returned that particular identifier. The information block placed on the stack by that GdipBeginContainer call is removed from the stack, and all information blocks placed on that stack after that GdipBeginContainer call are also removed.

 

Calls to the GdipSaveGraphics function place information blocks on the same stack as calls to the GdipBeginContainer function. Just as an GdipEndContainer call is paired with a GdipBeginContainer call, a GdipRestoreGraphics call is paired with a GdipSaveGraphics call.

 

Caution When you call GdipEndContainer, all information blocks placed on the stack (by GdipSaveGraphics or by GdipBeginContainer) after the corresponding call to GdipBeginContainer are removed from the stack. Likewise, when you call GdipRestoreGraphics, all information blocks placed on the stack (by  GdipSaveGraphics or by GdipBeginContainer) after the corresponding call to  GdipSaveGraphics are removed from the stack.

 

GdipEnumerateMetafileDestPoint

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoint(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST PointF & destPoint,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileDestPoint ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destPoint AS PointF, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destpoint

[in] Reference to a point that specifies the upper-left corner of the displayed metafile.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileDestPointI

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointI(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST Point & destPoint,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileDestPointI ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destPoint AS PointL, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destpoint

[in] Reference to a point that specifies the upper-left corner of the displayed metafile.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileDestPoints

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileDestPoints(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST PointF * destPoints,

    INT count,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileDestPoints ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destPoints AS PointF, _

    BYVAL count AS LONG, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destpoints

[in] Pointer to an array of destination points. This is an array of three points that defines the destination parallelogram for the displayed metafile.

count

[in] Long integer value  that specifies the number of points in the destPoints array.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileDestPointsI

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileDestPointsI(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST Point * destPoints,

    INT count,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileDestPointsI ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destPoints AS PointL, _

    BYVAL count AS LONG, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destpoints

[in] Pointer to an array of destination points. This is an array of three points that defines the destination parallelogram for the displayed metafile.

count

[in] Long integer value that specifies the number of points in the destPoints array.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileDestRect

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileDestRect(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST RectF & destRect,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileDestRect ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destRect AS RECTF, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destRect

[in] Reference to a RectF structure that specifies the rectangle in which the metafile is displayed.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileDestRectI

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileDestRectI(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST Rect & destRect,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileDestRectI ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destRect AS RECTL, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destRect

[in] Reference to a RectL structure that specifies the rectangle in which the metafile is displayed.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileSrcRectDestPoint

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoint(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST PointF & destPoint,

    GDIPCONST RectF & srcRect,

    Unit srcUnit,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileSrcRectDestPoint ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destPoint AS PointF, _

    BYREF srcRect AS RECTF, _

    BYVAL srcUnit AS LONG, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destpoint

[in] Reference to a point that specifies the upper-left corner of the displayed metafile.

srcRect

[in] Reference to a rectangle that specifies the portion of the metafile that is displayed.

srcUnit

[in] Element of the Unit enumeration that specifies the unit of measure for the source rectangle.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileSrcRectDestPointI

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointI(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST Point & destPoint,

    GDIPCONST Rect & srcRect,

    Unit srcUnit,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileSrcRectDestPoint ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destPoint AS PointL, _

    BYREF srcRect AS RECTL, _

    BYVAL srcUnit AS LONG, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destpoint

[in] Reference to a point that specifies the upper-left corner of the displayed metafile.

srcRect

[in] Reference to a rectangle that specifies the portion of the metafile that is displayed.

srcUnit

[in] Element of the Unit enumeration that specifies the unit of measure for the source rectangle.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileSrcRectDestPoints

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST PointF * destPoints,

    INT count,

    GDIPCONST RectF & srcRect,

    Unit srcUnit,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileSrcRectDestPoints ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destPoints AS PointF, _

    BYVAL count AS LONG, _

    BYREF srcRect AS RECTF, _

    BYVAL srcUnit AS LONG, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destpoints

[in] Pointer to an array of destination points. This is an array of three points that defines the destination parallelogram for the displayed metafile.

count

[in] Long integer value that specifies the number of points in the destPoints array.

srcRect

[in] Reference to a rectangle that specifies the portion of the metafile that is displayed.

srcUnit

[in] Element of the Unit enumeration that specifies the unit of measure for the source rectangle.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileSrcRectDestPointsI

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointsI(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST Point * destPoints,

    INT count,

    GDIPCONST Rect & srcRect,

    Unit srcUnit,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileSrcRectDestPointsI ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destPoints AS PointL, _

    BYVAL count AS LONG, _

    BYREF srcRect AS RECTL, _

    BYVAL srcUnit AS LONG, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destpoints

[in] Pointer to an array of destination points. This is an array of three points that defines the destination parallelogram for the displayed metafile.

count

[in] Long integer value that specifies the number of points in the destPoints array.

srcRect

[in] Reference to a rectangle that specifies the portion of the metafile that is displayed.

srcUnit

[in] Element of the Unit enumeration that specifies the unit of measure for the source rectangle.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileSrcRectDestRect

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestRect(

    GpGraphics * graphics,

    GDIPCONST GpMetafile * metafile,

    GDIPCONST RectF & destRect,

    GDIPCONST RectF & srcRect,

    Unit srcUnit,

    EnumerateMetafileProc callback,

    VOID * callbackData,

    GDIPCONST GpImageAttributes * imageAttributes

);

PowerBASIC Syntax

DECLARE FUNCTION GdipEnumerateMetafileSrcRectDestRect ( _

    BYVAL graphics AS DWORD, _

    BYVAL metafile AS DWORD, _

    BYREF destRect AS RECTF, _

    BYREF srcRect AS RECTF, _

    BYVAL srcUnit AS LONG, _

    BYVAL pcallback AS DWORD, _

    BYVAL callbackData AS DWORD, _

    BYVAL imageAttributes AS DWORD _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

metafile

[in] Pointer to a metafile to be enumerated.

destRect

[in] Pointer to an array of destination points. This is an array of three points that defines the destination parallelogram for the displayed metafile.

srcRect

[in] Reference to a rectangle that specifies the portion of the metafile that is displayed.

srcUnit

[in] Element of the Unit enumeration that specifies the unit of measure for the source rectangle.

callback

[in] Pointer to an application-defined callback function. The prototype for the callback function is given in Gdiplustypes.h.

callbackData

[in]  Pointer to a block of data that is passed to the callback function. The default value is NULL.

imageAttributes

[in] Pointer to an ImageAttributes object that specifies color adjustments for the displayed metafile. The default value is NULL.

 

GdipEnumerateMetafileSrcRectDestRectI

 

Description

Calls an application-defined callback function for each record in a specified metafile. You can use this method to display a metafile by calling GdipPlayMetafileRecord in the callback function.

Syntax

GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestRectI(