Server Error in '/' Application.

Parameter is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Parameter is not valid.

Source Error:


Line 17:         Dim iWidth As Double = imgGraphic.MeasureString(VerificationString, imageFont).Width
Line 18:         Dim iHeight As Double = imgGraphic.MeasureString(VerificationString, imageFont).Height
Line 19:         bmpImage = New Bitmap(CType(iWidth, Integer), CType(iHeight, Integer), PixleImagePattern)
Line 20:         imgGraphic = Graphics.FromImage(bmpImage)
Line 21:         imgGraphic.Clear(Color.White)

Source File: F:\webfeat.net\verImage.aspx.vb    Line: 19

Stack Trace:


[ArgumentException: Parameter is not valid.]
   System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) +427741
   verImage.generateImage(String VerificationString) in F:\webfeat.net\verImage.aspx.vb:19
   verImage.Page_Load(Object sender, EventArgs e) in F:\webfeat.net\verImage.aspx.vb:35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433