我把程序粘贴后报如下错误
Dim lPen As New System.Drawing.Pen(Color.Black) 名称“Color”未声明
Dim lBrush As New System.Drawing.SolidBrush(Color.Yellow) 名称“Color”未声明
.FillRectangle(lBrush, New RectangleF(0, 0, 100, 100)) 未定义类型:“RectangleF”
请问一下
With lBmpDraw
.FillRectangle(lBrush, New RectangleF(0, 0, 100, 100))
.DrawLine(lPen, 50, 0, 50, 100)
End With
这段代码的作用是什么,我有些不懂,谢谢啊
将下列代码粘到你的Page_Load(..)..中,运行后看看有什么效果?
Dim lMemStream As New System.IO.MemoryStream()
Dim lBmp As New System.Drawing.Bitmap(100, 100)
Dim lBmpDraw As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(lBmp)
Dim lPen As New System.Drawing.Pen(Color.Black)
Dim lBrush As New System.Drawing.SolidBrush(Color.Yellow)
With lBmpDraw
.FillRectangle(lBrush, New RectangleF(0, 0, 100, 100))
.DrawLine(lPen, 50, 0, 50, 100)
End With