关于基础的GDI的问题。。。。
各位大侠,我初学asp.net的GDI方面的知识,在试验中遇到了这样一个问题,下面是代码:
Imports System
Imports System.Web.UI
Imports System.Drawing
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CreateImage()
End Sub
Public Sub CreateImage()
Dim sDate As String = DateTime.Now().ToString()
Dim bImage As Bitmap = New Bitmap(200, 30)
Dim g As Graphics = Graphics.FromImage(bImage)
'Dim sFullName = Server.MapPath(".") + "\images\nowtime.gif"
Dim sFullName = "c:\nowtime.gif"
Response.Write(sFullName)
'Exit Sub
g.Clear(Color.White)
g.DrawString(sDate, New Font("Arial", 10), New SolidBrush(Color.Red), 20, 5)
bImage.Save(sFullName, Imaging.ImageFormat.Gif)
End Sub
在执行bImage.Save方法时出现错误,错误提示是:
GDI+ 中发生一般性错误。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Runtime.InteropServices.ExternalException: GDI+ 中发生一般性错误。
源错误:
行 68: g.Clear(Color.White)
行 69: g.DrawString(sDate, New Font("Arial", 10), New SolidBrush(Color.Red), 20, 5)
行 70: bImage.Save(sFullName, Imaging.ImageFormat.Gif) (本行!!)
行 71:
行 72: End Sub
请问这是为什么,怎么才能够解决呢??