Draws the specified text string in the specified rectangle with the specified
System.Windows.Media.Brush and
Font objects using the formatting attributes of the specified
StringFormat object.
'Declaration
Public Overloads Function DrawString( _
ByVal As String, _
ByVal As Font, _
ByVal As Color, _
ByVal As Rect, _
ByVal As Integer, _
ByVal As StringFormat _
) As Integer
public int DrawString(
string ,
Font ,
Color ,
Rect ,
int ,
StringFormat
)
Parameters
- text
- String to draw.
- font
- Font object that defines the appearance and size of the drawn text.
- color
- The color of the drawn text.
- rc
- The rectangle structure that specifies the location of the drawn text, in points from the top left corner of the page.
- firstChar
- Index of the first character that will be rendered.
- sf
- StringFormat object that specifies formatting attributes applied to the drawn text.
Return Value
The index of first character that was not printed because it did not fit in the specified rectangle.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2