Server Error in '/ImgGen' Application.

Specified argument was out of the range of valid values.
Parameter name: offset

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.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: offset

Source Error:


Line 23: 
Line 24: sig.decrypt = (Request.QueryString["decrypt"]=="1");
Line 25: sig.Generate(Response,Request);
Line 26: 
Line 27: %>

Source File: c:\inetpub\wwwroot\ImgGen\ScheduleGenerator.aspx    Line: 25

Stack Trace:


[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: offset]
   System.Web.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count) +8981160
   System.Web.HttpResponse.BinaryWrite(Byte[] buffer) +27
   ScheduleWebService.ScheduleImageGenerator.SendBitmap(HttpResponse res) +289
   ScheduleWebService.ScheduleImageGenerator.GenerateErrorImage(HttpResponse res, String error) +382
   ScheduleWebService.ScheduleImageGenerator.GetMetaFile(HttpResponse res, ScheduleImageFileFormat fileFormat, String schoolID, Int32 type, String ID, String period, String week, Int32 day, Int32 mode, Int32 width, Int32 height, Int32 maxWidth, Int32 maxHeight, Boolean printer, Int32 colors, Boolean head, Boolean clock, Boolean foot) +631
   ScheduleWebService.ScheduleImageGenerator.Generate(HttpResponse res, HttpRequest req) +3130
   ASP.schedulegenerator_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\wwwroot\ImgGen\ScheduleGenerator.aspx:25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266


Version Information: Microsoft .NET Framework Version:2.0.50727.9061; ASP.NET Version:2.0.50727.9062