Dim myPen As New Pen(Color.Black, 5)
Dim g As Graphics = Me.CreateGraphics
g.DrawEllipse(myPen, 20, 30, 10, 50)
Dim myPen As New Pen(Color.Black, 5)
Dim g As Graphics = Me.CreateGraphics
g.DrawEllipse(myPen, 20, 30, 10, 50)
你一定是将这些代码放在Load哪里!!
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")