Home COM GDI+ WebBrowser Data Access 

Text Functions (GDI+)

 

 

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.

 

GdipDrawDriverString

 

Description

Draws characters at the specified positions. The method gives the client complete control over the appearance of text. The method assumes that the client has already set up the format and layout to be applied.

Syntax

GpStatus WINGDIPAPI GdipDrawDriverString(

    GpGraphics *graphics,

    GDIPCONST UINT16 *text,

    INT length,

    GDIPCONST GpFont *font,

    GDIPCONST GpBrush *brush,

    GDIPCONST PointF *positions,

    INT flags,

    GDIPCONST GpMatrix *matrix

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawDriverString ( _

    BYVAL graphics AS DWORD, _

    BYVAL pText AS STRING, _

    BYVAL length AS LONG, _

    BYVAL pFont AS DWORD, _

    BYVAL brush AS DWORD, _

    BYREF positions AS PointF, _

    BYVAL flags AS LONG, _

    BYVAL matrix AS DWORD _

) AS LONG

Parameter

 

graphics

[in] Pointer to the Graphics object.

text

[in] Pointer to an array of 16-bit values. If the DriverStringOptionsCmapLookup flag is set, each value specifies a Unicode character to be displayed. Otherwise, each value specifies an index to a font glyph that defines a character to be displayed.

length

[in] Long integer value that specifies the number of values in the text array. The length parameter can be set to 1 if the string is null terminated.

font

[in] Pointer to a Font object that specifies the family name, size, and style of the font that is to be applied to the string.

brush

[in] Pointer to a Brush object that is used to fill the string.

positions

[in] If the DriverStringOptionsRealizedAdvance flag is set, positions is a pointer to a PointF structure that specifies the position of the first glyph. Otherwise, positions is an array of PointF structures, each of which specifies the origin of an individual glyph.

flags

[in] Long integer value  that specifies the options for the appearance of the string. This value must be an element of the DriverStringOptions enumeration or the result of a bitwise OR applied to two or more of these elements.

matrix

[in] Pointer to a Matrix object that specifies the transformation matrix to apply to each value in the text array.

 

GdipDrawString

 

Description

Draws a string based on a font, a layout rectangle, and a format.

Syntax

GpStatus WINGDIPAPI GdipDrawString(

    GpGraphics *graphics,

    GDIPCONST WCHAR *string,

    INT length,

    GDIPCONST GpFont *font,

    GDIPCONST RectF *layoutRect,

    GDIPCONST GpStringFormat *stringFormat,

    GDIPCONST GpBrush *brush

);

PowerBASIC Syntax

DECLARE FUNCTION GdipDrawString ( _

    BYVAL graphics AS DWORD, _

    BYVAL pString AS STRING, _

    BYVAL length AS LONG, _

    BYVAL pFont AS DWORD, _

    BYREF layoutRect AS RectF, _

    BYVAL stringFormat AS DWORD, _

    BYVAL brush AS DWORD _

) AS LONG

Parameter

 

graphics

[in] Pointer to the Graphics object.

string

[in] Pointer to a wide-character string to be drawn.

length

[in] Long integer value that specifies the number of characters in the string array. The length parameter can be set to 1 if the string is null terminated.

font

[in] Pointer to a Font object that specifies the font attributes (the family name, the size, and the style of the font) to use.

layoutRect

[in] Reference to a rectangle that bounds the string.

stringFormat

[in] Pointer to a StringFormat object that specifies text layout information and display manipulations to be applied to the string.

brush

[in] Pointer to a Brush object that is used to fill the string.

 

GdipMeasureCharacterRanges

 

Description

Gets a set of regions each of which bounds a range of character positions within a string.

Syntax

GpStatus WINGDIPAPI GdipMeasureCharacterRanges(

    GpGraphics *graphics,

    GDIPCONST WCHAR *string,

    INT length,

    GDIPCONST GpFont *font,

    GDIPCONST RectF &layoutRect,

    GDIPCONST GpStringFormat *stringFormat,

    INT regionCount,

    GpRegion **regions

);

PowerBASIC Syntax

DECLARE FUNCTION GdipMeasureCharacterRanges ( _

    BYVAL graphics AS DWORD, _

    BYVAL pString AS STRING, _

    BYVAL length AS LONG, _

    BYVAL pFont AS DWORD, _

    BYREF layoutRect AS RectF, _

    BYVAL stringFormat AS DWORD, _

    BYVAL regionCount AS LONG, _

    BYREF regions AS LONG _

) AS LONG

Parameter

 

graphics

[in] Pointer to the Graphics object.

string

[in] Pointer to a wide-character string.

length

[in] Long integer value that specifies the number of characters in the string array. If the string parameter points to a NULL-terminated string, this parameter can be set to 1.

font

[in] Pointer to a Font object that specifies the font characteristics (the family name, size, and style of the font) to be applied to the string.

layoutRect

[in] Reference to a rectangle that bounds the string.

stringFormat

[in] Pointer to a StringFormat object that specifies the character ranges and layout information, such as alignment, trimming, tab stops, and so forth.

regionCount

[in] Long integer value that specifies the number of regions that are expected to be received into the regions array. This number should be equal to the number of character ranges currently in the StringFormat object.

regions

[out] Pointer to an array of Region objects that receives the regions, each of which bounds a range of text.

 

GdipMeasureDriverString

 

Description

Measures the bounding box for the specified characters and their corresponding positions.

Syntax

GpStatus WINGDIPAPI GdipMeasureDriverString(

    GpGraphics *graphics,

    GDIPCONST UINT16 *text,

    INT length,

    GDIPCONST GpFont *font,

    GDIPCONST PointF *positions,

    INT flags,

    GDIPCONST GpMatrix *matrix,

    RectF *boundingBox

);

PowerBASIC Syntax

DECLARE FUNCTION GdipMeasureDriverString ( _

    BYVAL graphics AS DWORD, _

    BYVAL pText AS STRING, _

    BYVAL length AS LONG, _

    BYVAL pFont AS DWORD, _

    BYREF positions AS PointF, _

    BYVAL flags AS LONG, _

    BYVAL matrix AS DWORD, _

    BYREF boundingBox AS RectF _

) AS LONG

Parameter

 

graphics

[in] Pointer to the Graphics object.

string

[in] Pointer to an array of 16-bit values. If the DriverStringOptionsCmapLookup flag is set, each value specifies a Unicode character to be displayed. Otherwise, each value specifies an index to a font glyph that defines a character to be displayed.

length

[in] Long integer value that specifies the number of values in the text array. The length parameter can be set to 1 if the string is null terminated.

font

[in] Pointer to a Font object that specifies the family name, size, and style of the font to be applied to the string.

positions

[in] If the DriverStringOptionsRealizedAdvance flag is set, positions is a pointer to a PointF structure that specifies the position of the first glyph. Otherwise, positions is an array of PointF objects, each of which specifies the origin of an individual glyph.

flags

[in] Long integer value that specifies the options for the appearance of the string. This value must be an element of the DriverStringOptions enumeration or the result of a bitwise OR applied to two or more of these elements.

matrix

[in] Pointer to a Matrix object that specifies the transformation matrix to apply to each value in the text array.

boundingBox

[out] Pointer to a RectF structure that receives the rectangle that bounds the string.

 

GdipMeasureString

 

Description

Measures the extent of the string in the specified font, format, and layout rectangle.

Syntax

GpStatus WINGDIPAPI GdipMeasureString(

    GpGraphics *graphics,

    GDIPCONST WCHAR *string,

    INT length,

    GDIPCONST GpFont *font,

    GDIPCONST RectF *layoutRect,

    GDIPCONST GpStringFormat *stringFormat,

    RectF *boundingBox,

    INT *codepointsFitted,

    INT *linesFilled

);

PowerBASIC Syntax

DECLARE FUNCTION GdipMeasureString ( _

    BYVAL graphics AS DWORD, _

    BYVAL pString AS STRING, _

    BYVAL length AS LONG, _

    BYVAL pFont AS DWORD, _

    BYREF layoutRect AS RectF, _

    BYVAL stringFormat AS DWORD, _

    BYREF boundingBox AS RectF, _

    BYREF codepointsFitted AS LONG, _

    BYREF linesFilled AS LONG _

) AS LONG

Parameter

 

graphics

[in] Pointer to the Graphics object.

string

[in] Pointer to a wide-character string to be measured.

length

[in] Integer that specifies the number of characters in the string array. The length parameter can be set to 1 if the string is null terminated.

font

[in] Pointer to a Font object that specifies the family name, size, and style of the font to be applied to the string.

layoutRect

[in] Reference to the rectangle that bounds the string.

stringFormat

[in] Pointer to a StringFormat object that specifies the layout information, such as alignment, trimming, tab stops, and so forth.

boundingBox

[out] Pointer to a RectF structure that receives the rectangle that bounds the string.

codePointsFitted

[out] Pointer to an LONG that receives the number of characters that actually fit into the layout rectangle. The default value is a NULL pointer.

linesFilled

[out] Pointer to an LONG that receives the number of lines that fit into the layout rectangle. The default value is a NULL pointer.

 

Page last updated on Monday, 11 December 2006 11:01:31 +0100