Web ページにグラフィックスをレンダリングする 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()