Graphics.DrawDriverString method

Applies to: desktop apps only

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.


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


text [in]

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.

length [in]

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.

font [in]

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.

brush [in]

Type: const Brush*

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

positions [in]

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.

flags [in]

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.

matrix [in]

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.


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.


Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server


GDI+ 1.0


Gdiplusgraphics.h (include Gdiplus.h)





See also

DrawString Methods



Send comments about this topic to Microsoft

Build date: 3/6/2012