Listing A


Width = CInt(Math.Ceiling(GraphicsMapEditor.MeasureString(Text, FontForText).Width + 2))
Height = CInt(Math.Ceiling(GraphicsMapEditor.MeasureString(Text, FontForText).Height + 2))
 BitmapText = New Bitmap(Width, Height)
GraphicsTextEditor = Graphics.FromImage(BitmapText)
GraphicsTextEditor.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit
GraphicsTextEditor.DrawString(Text, FontForText, BrushText, 1, 1)