---
title: "GdiGraphics..::.DrawString Method (String, Font, SolidBrush, Int32, Int32, array&lt;Int32&gt;[]()[])"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawString_6_b68f1f7e.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# GdiGraphics.DrawString Method (String, Font, SolidBrush, Int32, Int32, Int32[])
 
Draws a text string without any special effects.
 
**Namespace:** [Aurigma.GraphicsMill.Drawing](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub DrawString ( _s As String, _font As Font, _brush As SolidBrush, _x As Integer, _y As Integer, _kernings As Integer() _
)
```
 
```csharp
public void DrawString(string s,Font font,SolidBrush brush,int x,int y,int[] kernings
)
```
 
### Parameters
 
 - s
     - Type: [System.String](http://msdn2.microsoft.com/en-us/s1wwdcbf)
String to draw.

 - font
     - Type: [Aurigma.GraphicsMill.Drawing.Font](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_Font.htm.md)
 [Font](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_Font.htm.md) object specifying text rendering options.

 - brush
     - Type: [Aurigma.GraphicsMill.Drawing.SolidBrush](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_SolidBrush.htm.md)
 [SolidBrush](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_SolidBrush.htm.md) object containing font color.

 - x
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
X-coordinate of the text output point. Actual position of the text relatively this point is defined with [HorizontalAlignment](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_HorizontalAlignment.htm.md) and [VerticalAlignment](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_VerticalAlignment.htm.md) properties of the *font* argument.

 - y
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Y-coordinate of the text output point. Actual position of the text relatively this point is defined with [HorizontalAlignment](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_HorizontalAlignment.htm.md) and [VerticalAlignment](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_VerticalAlignment.htm.md) properties of the *font* argument.

 - kernings
     - Type:  [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d) []
Array of kerning modifiers. The first entry of this array specify additional distance (may be negative) between first and second character of the string; the second entry specifies additional distance between second and third character, etc.
 
## Remarks
  
All the coordinates are measured in units specified with [Unit](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_UnitConverterObject_Unit.htm.md) property.
 
**Note** 
If you draw text on indexed bitmaps, antialiasing is disabled regardless to the [Antialiased](https://www.graphicsmill.com/docs/gm5/P_Aurigma_GraphicsMill_Drawing_Font_Antialiased.htm.md) property value. Also, if the [GdiGraphics](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md) was created on the base of the [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) which has [Format8bppGrayScale](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_PixelFormat.htm.md) pixel format, antialiasing will not be applied for text output. The reason of this issue is that GDI does not support grayscale bitmaps. That's why Graphics Mill for .NET represents this image as [Format8bppIndexed](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_PixelFormat.htm.md) bitmap with grayscale palette.
 
## Examples
  
```
Dim bitmap As New Aurigma.GraphicsMill.Bitmap( _
 Aurigma.GraphicsMill.RgbColor.White, 300, 30, _
 Aurigma.GraphicsMill.PixelFormat.Format24bppRgb)

Dim graphics As Aurigma.GraphicsMill.Drawing.GdiGraphics = bitmap.GetGdiGraphics

'Draw text
Dim font As New Aurigma.GraphicsMill.Drawing.Font("Arial", 20)

Dim brush As New Aurigma.GraphicsMill.Drawing.SolidBrush( _
 Aurigma.GraphicsMill.RgbColor.Red)

Dim kernings As Single() = New Single() {2, 4, 6, 8, 10, 12, 14}

graphics.DrawString("Aurigma", font, brush, 10, 0, kernings)
```
 
```csharp
Aurigma.GraphicsMill.Bitmap bitmap  = new Aurigma.GraphicsMill.Bitmap(
    Aurigma.GraphicsMill.RgbColor.White, 300, 30,
    Aurigma.GraphicsMill.PixelFormat.Format24bppRgb);

Aurigma.GraphicsMill.Drawing.GdiGraphics graphics = bitmap.GetGdiGraphics();

//Draw text
Aurigma.GraphicsMill.Drawing.Font font =
    new Aurigma.GraphicsMill.Drawing.Font("Arial", 20);

Aurigma.GraphicsMill.Drawing.SolidBrush brush =
    new Aurigma.GraphicsMill.Drawing.SolidBrush(Aurigma.GraphicsMill.RgbColor.Red);

float[] kernings  = new float[] {2, 4, 6, 8, 10, 12, 14};

graphics.DrawString("Aurigma", font, brush, 10, 0, kernings);
```
   
## See Also

### Reference

- [GdiGraphics Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md)
- [DrawString Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Drawing_GdiGraphics_DrawString.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
