This documentation is for the old version. Go to the latest Graphics Mill docs

Overview of Text Drawing

Text rendering is a very important task applied to various types of software. Graphics Mill for .NET implements this functionality and provides a lot of adjustments to display the desired text. Using Graphics Mill for .NET you can draw both single-line and multiline text on RGB, indexed or grayscale images. It is also possible to draw text on a CMYK bitmap but it requires additional steps described in the Drawing Text on a CMYK Bitmap article.


When you try to draw text on a grayscale bitmap, you will notice that the text is not antialiased. The reason of this problem is that neither GDI nor GDI+ support grayscale bitmaps, therefore Graphics Mill for .NET has to imitate it as indexed bitmap with grayscale palette. However, antialiasing is impossible on indexed bitmaps.

Graphics Mill for .NET provides the possibility to make your text more attractive by applying some effects: shadow, glow, 3D, etc. See the Drawing Text with Effects topic for detailed information and samples on how to draw text with such effects. One more way to make your text eye-catching is to outline it using any approach described in the Drawing Text with Outline article.

To draw text with Graphics Mill for .NET you will need to use the Font and GdiGraphics classes. Let us consider them more detailed.

The Font Class

This class provides an access to font and text rendering settings. They include:

The Font class also implements functionality to retrieve font metrics, and other font-related information. For example:

There are two ways to set a font in Graphics Mill for .NET. The first way is to specify font family name, size and boolean values indicating whether the rendered text is bold, italic, underlined and so on. The second way is to use a PostScript name of the font installed on the computer. To apply the first one you can use any constructor of the Font class. The second one can be applied using the Font.CreateSpecificFont(String, Boolean, Single) static method which returns the font with the requested name. The PostScript format is commonly used in Adobe applications. So this way can be suitable to raster text layers extracted from PSD files using Advanced PSD Add-on.

The GdiGraphics Class

This class represents drawing functionality provided by Graphics Mill for .NET. It implements three overloaded methods to draw a text:

  • DrawString methods draw single-line and outlined text. See Drawing Text String article to obtain the details on how to draw text using this method.
  • DrawText methods draw single-style multiline text. The Drawing Multiline Text article contains the detailed information about multiline text drawing.
  • DrawFormattedText methods provide a possibility to render multi-style text. It means that text can include portions rendered using different font settings. To specify style for each portion text should be marked up using certain rules. These rules are completely described in the Drawing Formatted Text article.