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.

 

GdipIsClipEmpty

 

Description

Determines whether the clipping region of this Graphics object is empty.

Syntax

GpStatus WINGDIPAPI GdipIsClipEmpty(

    GpGraphics *graphics,

    BOOL *result

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsClipEmpty ( _

    BYVAL graphics AS DWORD, _

    BYREF result AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

result

[out] Pointer to a variable that receives a boolean value that determines whether the clipping region of this Graphics object is empty (TRUE) or not (FALSE).

Remarks

If the clipping region of a Graphics object is empty, there is no area left in which to draw. Consequently, nothing will be drawn when the clipping region is empty.

 

GdipIsVisibleClipEmpty

 

Description

Determines whether the visible clipping region of this Graphics object is empty. The visible clipping region is the intersection of the clipping region of this Graphics object and the clipping region of the window.

Syntax

GpStatus WINGDIPAPI GdipIsVisibleClipEmpty(

    GpGraphics *graphics,

    BOOL *result

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsVisibleClipEmpty ( _

    BYVAL graphics AS DWORD, _

    BYREF result AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

result

[out] Pointer to a variable that receives a boolean value that determines whether the visible clipping region of this Graphics object is empty (TRUE) or not (FALSE).

Remarks

If the clipping region of a Graphics object is empty, there is no area left in which to draw. Consequently, nothing will be drawn when the clipping region is empty.

 

GdipIsVisiblePoint

 

Description

Determines whether the specified point is inside the visible clipping region of this Graphics object. The visible clipping region is the intersection of the clipping region of this Graphics object and the clipping region of the window.

Syntax

GpStatus WINGDIPAPI GdipIsVisiblePoint(

    GpGraphics *graphics,

    REAL x,

    REAL y,

    BOOL *result

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsVisiblePoint ( _

    BYVAL graphics AS DWORD, _

    BYVAL x AS SINGLE, _

    BYVAL y AS SINGLE, _

    BYREF result AS LONG _

) AS LONG

 arameters

 

graphics

[in] Pointer to the Graphics object.

x

[in] Simple precision value that specifies the x-coordinate of the point to test.

y

[in] Simple precision value that specifies the y-coordinate of the point to test.

result

[out] Pointer to a variable that receives a boolean value that determines whether the specified point is inside the visible clipping region of this Graphics object (TRUE) or not (FALSE).

 

GdipIsVisiblePointI

 

Description

Determines whether the specified point is inside the visible clipping region of this Graphics object. The visible clipping region is the intersection of the clipping region of this Graphics object and the clipping region of the window.

Syntax

GpStatus WINGDIPAPI GdipIsVisiblePointI(

    GpGraphics *graphics,

    INT x,

    INT y,

    BOOL *result

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsVisiblePointI ( _

    BYVAL graphics AS DWORD, _

    BYVAL x AS LONG, _

    BYVAL y AS LONG, _

    BYREF result AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

x

[in] Long integer value that specifies the x-coordinate of the point to test.

y

[in] Long integer value that specifies the y-coordinate of the point to test.

result

[out] Pointer to a variable that receives a boolean value that determines whether the specified point is inside the visible clipping region of this Graphics object (TRUE) or not (FALSE).

 

GdipIsVisibleRect

 

Description

Determines whether the specified point is inside the visible clipping region of this Graphics object. The visible clipping region is the intersection of the clipping region of this Graphics object and the clipping region of the window.

Syntax

GpStatus WINGDIPAPI GdipIsVisibleRect(

    GpGraphics *graphics,

    REAL x,

    REAL y,

    REAL width,

    REAL height,

    BOOL *result

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsVisibleRect ( _

    BYVAL graphics AS DWORD, _

    BYVAL x AS SINGLE, _

    BYVAL y AS SINGLE, _

    BYVAL nWidth AS SINGLE, _

    BYVAL nHeight AS SINGLE, _

    BYREF result AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

x

[in] Simple precision value that specifies the x-coordinate of the rectangle to test.

y

[in] Simple precision value that specifies the y-coordinate of the rectangle to test.

width

[in] Simple precision value that specifies the width of the rectangle to test.

height

[in] Simple precision value that specifies the height of the rectangle to test.

result

[out] Pointer to a variable that receives a boolean value that determines whether the specified rectangle intersects the visible clipping region of this Graphics object (TRUE) or not (FALSE).

 

GdipIsVisibleRectI

 

Description

Determines whether the specified point is inside the visible clipping region of this Graphics object. The visible clipping region is the intersection of the clipping region of this Graphics object and the clipping region of the window.

Syntax

GpStatus WINGDIPAPI GdipIsVisibleRectI(

    GpGraphics *graphics,

    INT x,

    INT y,

    INT width,

    INT height,

    BOOL *result

);

PowerBASIC Syntax

DECLARE FUNCTION GdipIsVisibleRectI ( _

    BYVAL graphics AS DWORD, _

    BYVAL x AS LONG, _

    BYVAL y AS LONG, _

    BYVAL nWidth AS LONG, _

    BYVAL nHeight AS LONG, _

    BYREF result AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

x

[in] Long integer value that specifies the x-coordinate of the rectangle to test.

y

[in] Long integer valuethat specifies the y-coordinate of the rectangle to test.

width

[in] Long integer valuethat specifies the width of the rectangle to test.

height

[in] Long integer valuethat specifies the height of the rectangle to test.

result

[out] Pointer to a variable that receives a boolean value that determines whether the specified rectangle intersects the visible clipping region of this Graphics object (TRUE) or not (FALSE).

 

GdipMultiplyWorldTransform

 

Description

Updates this Graphics object's world transformation matrix with the product of itself and another matrix.

Syntax

GpStatus WINGDIPAPI GdipMultiplyWorldTransform(

    GpGraphics *graphics,

    GDIPCONST GpMatrix *matrix,

    GpMatrixOrder order

);

PowerBASIC Syntax

DECLARE FUNCTION GdipMultiplyWorldTransform ( _

    BYVAL graphics AS DWORD, _

    BYVAL matrix AS DWORD, _

    BYVAL order AS LONG _

) AS LONG

Parameters

 

graphics

[in] Pointer to the Graphics object.

matrix

[in] Pointer to a matrix that will be multiplied by the world transformation matrix of this Graphics object.

order

[in] Element of the MatrixOrder enumeration that specifies the order of multiplication. MatrixOrderPrepend specifies that the passed matrix is on the left, and MatrixOrderAppend specifies that the passed matrix is on the right. The default value is MatrixOrderPrepend.

 

GdipPlayMetafileRecord

 

Description

Plays a metafile record.

Syntax

GpStatus WINGDIPAPI GdipPlayMetafileRecord(

    GDIPCONST GpMetafile * metafile,

    EmfPlusRecordType recordType,

    UINT flags,

    UINT dataSize,

    GDIPCONST BYTE * data

);

PowerBASIC Syntax

DECLARE FUNCTION GdipPlayMetafileRecord ( _

    BYVAL metafile AS DWORD, _

    BYVAL recordType AS LONG, _

    BYVAL flags AS DWORD, _

    BYVAL dataSize AS DWORD, _

    BYREF pData AS ANY _

) AS LONG

Parameters

 

metafile

[in] Pointer to the Metafile object.

recordtype

[in] Element of the EmfPlusRecordType enumeration that specifies the type of metafile record to be played.

flags

[in] Set of flags that specify attributes of the record to be played.

datasize

[in] Long integer value that specifies the number of bytes contained in the record data.

data

[in] Pointer to an array of bytes that contains the record data.

 

GdipRecordMetafile

 

Description

Creates a Metafile object for recording.

Syntax

GpStatus WINGDIPAPI GdipRecordMetafile(

    HDC referenceHdc,

    EmfType type,

    GDIPCONST GpRectF * frameRect,

    MetafileFrameUnit frameUnit,

    GDIPCONST WCHAR * description,

    GpMetafile ** metafile

);

PowerBASIC Syntax

DECLARE FUNCTION GdipRecordMetafile ( _

    BYVAL referenceHdc AS DWORD, _

    BYVAL pType AS LONG, _

    BYREF frameRect AS RECTF, _

    BYVAL frameUnit AS LONG, _

    BYVAL description AS STRING, _

    BYREF metafile AS DWORD _

) AS LONG

Parameters

 

referenceHdc

[in] Windows handle to a device context that contains attributes of the display device that is used to record the metafile.

type

[in] Element of the EmfType enumeration that specifies the type of metafile that will be recorded. The default value is EmfTypeEmfPlusDual.

frameRect

[in] Reference to a rectangle that bounds the metafile display.

frameUnit

[in] Element of the MetafileFrameUnit enumeration that specifies the unit of measure for frameRect. The default value is MetafileFrameUnitGdi.

description

[in] Pointer to a wide-character string that specifies the descriptive name of the metafile. The default value is NULL.

metafile

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

Remarks

When recording to a file, the file must be writable, and GDI+ must be able to obtain an exclusive lock on the file.

 

GdipRecordMetafileName

 

Description

Creates a Metafile object for recording.

Syntax

GpStatus WINGDIPAPI GdipRecordMetafileFileName(

    GDIPCONST WCHAR* fileName,

    HDC referenceHdc,

    EmfType type,

    GDIPCONST GpRectF * frameRect,

    MetafileFrameUnit frameUnit,

    GDIPCONST WCHAR * description,

   GpMetafile ** metafile

);

PowerBASIC Syntax

DECLARE FUNCTION GdipRecordMetafileFileName ( _

    BYVAL pFilename AS STRING _

    BYVAL referenceHdc AS DWORD _

    BYVAL pType AS LONG _

    BYREF frameRect AS RECTF _

    BYVAL frameUnit AS LONG _

    BYVAL description AS STRING _

    BYREF metafile AS DWORD _

) AS LONG

Parameters

 

filename

[in] Pointer to a wide-character string that specifies the name of the file in which the metafile will be saved.

referenceHdc

[in] Windows handle to a device context that contains attributes of a display device.

type

[in] Element of the EmfType enumeration that specifies the type of metafile that will be recorded. The default value is EmfTypeEmfPlusDual.

frameRect

[in] Reference to a rectangle that bounds the metafile display.

frameUnit

[in] Element of the MetafileFrameUnit enumeration that specifies the unit of measure for frameRect. The default value is MetafileFrameUnitGdi.

description

[in] Pointer to a wide-character string that specifies the descriptive name of the metafile. The default value is NULL.

metafile

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

Remarks

When recording to a file, the file must be writable, and GDI+ must be able to obtain an exclusive lock on the file.

 

GdipRecordMetafileNameI

 

Description

Creates a Metafile object for recording.

Syntax

GpStatus WINGDIPAPI GdipRecordMetafileFileNameI(

    GDIPCONST WCHAR* fileName,

    HDC referenceHdc,

    EmfType type,

    GDIPCONST GpRect * frameRect,

    MetafileFrameUnit frameUnit,

    GDIPCONST WCHAR * description,

    GpMetafile ** metafile

);

PowerBASIC Syntax

DECLARE FUNCTION GdipRecordMetafileFileNameI ( _

    BYVAL pFilename AS STRING _

    BYVAL referenceHdc AS DWORD _

    BYVAL pType AS LONG _

    BYREF frameRect AS RECTL _

    BYVAL frameUnit AS LONG _

    BYVAL description AS STRING _

    BYREF metafile AS DWORD _

) AS LONG

Parameters

 

filename

[in] Pointer to a wide-character string that specifies the name of the file in which the metafile will be saved.

referenceHdc

[in] Windows handle to a device context that contains attributes of a display device.

type

[in] Element of the EmfType enumeration that specifies the type of metafile that will be recorded. The default value is EmfTypeEmfPlusDual.

frameRect

[in] Reference to a rectangle that bounds the metafile display.

frameUnit

[in] Element of the MetafileFrameUnit enumeration that specifies the unit of measure for frameRect. The default value is MetafileFrameUnitGdi.

description

[in] Pointer to a wide-character string that specifies the descriptive name of the metafile. The default value is NULL.

metafile

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

Remarks

When recording to a file, the file must be writable, and GDI+ must be able to obtain an exclusive lock on the file.

 

GdpiRecordMetafileI

 

Description

Creates a Metafile object for recording.

Syntax

GpStatus WINGDIPAPI GdipRecordMetafileI(

    HDC referenceHdc,

    EmfType type,

    GDIPCONST GpRect * frameRect,

    MetafileFrameUnit frameUnit,

    GDIPCONST WCHAR * description,

    GpMetafile ** metafile

);

PowerBASIC Syntax

DECLARE FUNCTION GdipRecordMetafileI ( _

    BYVAL referenceHdc AS DWORD, _

    BYVAL pType AS LONG, _

    BYREF frameRect AS RECTL, _

    BYVAL frameUnit AS LONG, _

    BYVAL description AS STRING, _

    BYREF metafile AS DWORD _

) AS LONG

Parameters

 

referenceHdc

[in] Windows handle to a device context that contains attributes of the display device that is used to record the metafile.

type

[in] Element of the EmfType enumeration that specifies the type of metafile that will be recorded. The default value is EmfTypeEmfPlusDual.

frameRect

[in] Reference to a rectangle that bounds the metafile display.

frameUnit

[in] Element of the MetafileFrameUnit enumeration that specifies the unit of measure for frameRect. The default value is MetafileFrameUnitGdi.

description

[in] Pointer to a wide-character string that specifies the descriptive name of the metafile. The default value is NULL.

metafile

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

Remarks

When recording to a file, the file must be writable, and GDI+ must be able to obtain an exclusive lock on the file.

 

GdipRecordMetafileStream

 

Description

Creates a Metafile object for recording to an IStream interface.

Syntax

GpStatus WINGDIPAPI GdipRecordMetafileStream(

    IStream * stream,

    HDC referenceHdc,

    EmfType type,

    GDIPCONST GpRectF * frameRect,

    MetafileFrameUnit frameUnit,

    GDIPCONST WCHAR * description,

    GpMetafile ** metafile

);

PowerBASIC Syntax

DECLARE FUNCTION GdipRecordMetafileStream ( _

    BYVAL pStream AS DWORD, _

    BYVAL referenceHdc AS DWORD, _

    BYVAL pType AS LONG, _

    BYREF frameRect AS RECTF, _

    BYVAL frameUnit AS LONG, _

    BYVAL description AS STRING, _

    BYREF metafile AS DWORD _

) AS LONG

Parameters

 

stream

[in] Pointer to a COM IStream interface that points to a stream of data in a file. When the commands are recorded, they will be saved to this stream.

referenceHdc

[in] Windows handle to a device context that contains attributes of the display device that is used to record the metafile.

type

[in] Element of the EmfType enumeration that specifies the type of metafile that will be recorded. The default value is EmfTypeEmfPlusDual.

frameRect

[in] Reference to a rectangle that bounds the metafile display.

frameUnit

[in] Element of the MetafileFrameUnit enumeration that specifies the unit of measure for frameRect. The default value is MetafileFrameUnitGdi.

description

[in] Pointer to a wide-character string that specifies the descriptive name of the metafile. The default value is NULL.

metafile

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

Remarks

When recording to a file, the file must be writable, and GDI+ must be able to obtain an exclusive lock on the file.

 

GdipRecordMetafileStreamI

 

Description

Creates a Metafile object for recording to an IStream interface.

Syntax

GpStatus WINGDIPAPI GdipRecordMetafileStreamI(

    IStream * stream,

    HDC referenceHdc,

    EmfType type,

    GDIPCONST GpRect * frameRect,

    MetafileFrameUnit frameUnit,

    GDIPCONST WCHAR * description,

    GpMetafile ** metafile

);

PowerBASIC Syntax

DECLARE FUNCTION GdipRecordMetafileStreamI ( _

    BYVAL pStream AS DWORD, _

    BYVAL referenceHdc AS DWORD, _

    BYVAL pType AS LONG, _

    BYREF frameRect AS RECTL, _

    BYVAL frameUnit AS LONG, _

    BYVAL description AS STRING, _

    BYREF metafile AS DWORD _

) AS LONG

Parameters

 

stream

[in] Pointer to a COM IStream interface that points to a stream of data in a file. When the commands are recorded, they will be saved to this stream.

referenceHdc

[in] Windows handle to a device context that contains attributes of the display device that is used to record the metafile.

type

[in] Element of the EmfType enumeration that specifies the type of metafile that will be recorded. The default value is EmfTypeEmfPlusDual.

frameRect

[in] Reference to a rectangle that bounds the metafile display.

frameUnit

[in] Element of the MetafileFrameUnit enumeration that specifies the unit of measure for frameRect. The default value is MetafileFrameUnitGdi.

description

[in] Pointer to a wide-character string that specifies the descriptive name of the metafile. The default value is NULL.

metafile

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

Remarks

When recording to a file, the file must be writable, and GDI+ must be able to obtain an exclusive lock on the file.

 

GdipReleaseDC

 

Description

Releases a device context handle obtained by a previous call to the GdipGetDC function.

Syntax

GpStatus WINGDIPAPI GdipReleaseDC(