获得一个Graphics对象
设置Brush和Font参数
用Graphics的DrawString方法
Dim g As Graphics
Dim objBitmap As New Bitmap(100, 100)
Dim stringFont As New Font("宋体", 13, FontStyle.Bold)
Dim r As New Rectangle(50, 50, 20, 20)
Dim stringTitle As New Font("Times New Roman", 14, FontStyle.Bold)
'Dim stringFont As New Font("Times New Roman", 10, FontStyle.Bold)
Dim stringFormat As New StringFormat
Dim b As New SolidBrush(Color.Black)
Dim rTitle As RectangleF
g = Graphics.FromImage(objBitmap)
Dim p As New Pen(Color.Black, 1)
g.DrawLine(p, 0, 50, 50, 0)
g.DrawLine(p, 50, 0, 100, 50)
g.DrawLine(p, 100, 50, 50, 100)
g.DrawLine(p, 50, 100, 0, 50)
g.DrawString("测试", stringTitle, b, rTitle, StringFormat)
objBitmap.Save("aa.jpg")