Graphics::DrawDriverString method (gdiplusgraphics.h)

The Graphics::DrawDriverString method 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

Status DrawDriverString(
  [in] const UINT16 *text,
  [in] INT          length,
  [in] const Font   *font,
  [in] const Brush  *brush,
  [in] const PointF *positions,
  [in] INT          flags,
  [in] const Matrix *matrix
);

Parameters

[in] text

Type: const UINT16*

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.

[in] length

Type: INT

Integer that specifies the number of values in the text array. The length parameter can be set to –1 if the string is null terminated.

[in] font

Type: const Font*

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

[in] brush

Type: const Brush*

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

[in] positions

Type: const PointF*

If the DriverStringOptionsRealizedAdvance flag is set, positions is a pointer to a PointF object 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.

[in] flags

Type: INT

Integer 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.

[in] matrix

Type: const Matrix*

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

Return value

Type: Status

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

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

Remarks

This method does not support the handling of complex scripts and assumes that the client has set up all text layout in some other way. This method is useful for creating owner-drawn menu items. The client should use the DrawString Methods method for general purposes.

Requirements

Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header gdiplusgraphics.h (include Gdiplus.h)
Library Gdiplus.lib
DLL Gdiplus.dll

See also

Brush

DrawString Methods

DriverStringOptions

Font

Graphics

Graphics::MeasureDriverString

Matrix

PointF