Easy Way to Learn ASP.NET

GDI+ Tutorial

GDI+ Introduction
GDI+ Lines
GDI+ Rectangles
GDI+ Ellipses
GDI+ Arcs
GDI+ Polygons
GDI+ Cardinal Splines
GDI+ Bezier Splines
GDI+ Graphics Paths
GDI+ Brushes
GDI+ Regions
GDI+ Antialiasing
GDI+ Bitmaps
GDI+ Metafiles
GDI+ Transformations
GDI+ Text

Drawing Text Using GDI+

You can draw text on ASP.NET page using GDI+. The GDI+ Graphics class has several DrawString methods that allow you to draw text.

The following is the syntax of the DrawString methods:

DrawString(ByVal s As String, ByVal font As System.Drawing.Font, ByVal brush As System.Drawing.Brush, ByVal x As Single, ByVal y As Single)

or

DrawString(ByVal s As String, ByVal font As System.Drawing.Font, ByVal brush As System.Drawing.Brush, ByVal x As Single, ByVal y As Single, ByVal format As System.Drawing.StringFormat)

or

DrawString(ByVal s As String, ByVal font As System.Drawing.Font, ByVal brush As System.Drawing.Brush, ByVal layoutRectangle As System.Drawing.RectangleF)

or

DrawString(ByVal s As String, ByVal font As System.Drawing.Font, ByVal brush As System.Drawing.Brush, ByVal layoutRectangle As System.Drawing.RectangleF, ByVal format As System.Drawing.StringFormat)


Drawing Text

You can draw text on ASP.NET page using DrawString method of the Graphics class.

The following code example demonstrates how to draw text: