Jag försöker skapa en bil med den här koden
Response.ContentType = "image/gif"
Dim bmp As Bitmap = New Bitmap(500, 40)
Dim g As Graphics = Graphics.FromImage(bmp)
Dim brBlue As New SolidBrush(ColorTranslator.FromHtml(_color))
Dim HeadlineFont As New Font(_font, _fontSize, FontStyle.Regular, GraphicsUnit.Pixel)
bmp.SetResolution(72, 72)
g.FillRectangle(New SolidBrush(Color.White), _
New Rectangle(0, 0, bmp.Width, bmp.Height))
g.TextRenderingHint = TextRenderingHint.AntiAlias
g.DrawString(_text, HeadlineFont, brBlue, 0, 0)
bmp.Save("bild.gif", ImageFormat.Gif)
bmp.Dispose()
g.Dispose()
Jag får det här felmeddelandet
Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
Source Error:
Line 55:
Line 56:
Line 57: bmp.Save("bild.gif", ImageFormat.Gif)
Line 58: bmp.Dispose()
Line 59: g.Dispose()
Source File: d:\inetpub\wwwroot\lemanchester\bildtest.aspx.vb Line: 57