我有一个 Visual Studio 2003 应用程序,可以将图形呈现到我的网页上。自从我使用它已经有一段时间了,但我将代码复制并粘贴到一个新的 2008 Visual Studio Vb.Net 项目中,屏幕上的输出只是很多符号而不是图形。
我做了一个简短的测试代码,它不会工作。我错过了什么?
Dim X As Integer = 0
Dim Y As Integer = 0
'Build a BitMap that will act as the pallet and container
Dim objBitMap As New Bitmap(360, 360)
'Declare your Graphics objects for painting graphics on your newly created bitmap.
Dim objGraphics As Graphics
objGraphics = Graphics.FromImage(objBitMap)
objGraphics.Clear(Color.White)
objGraphics.DrawLine(New Pen(Color.Red), 0, 0, 200, 200)
objBitMap.Save(Response.OutputStream, ImageFormat.Gif)
objBitMap.Dispose()
objGraphics.Dispose()