Image Save Error


B

Barry

Hi

Does anyone know why i am getting the following error message (line 64)
, if i change to objBitmap.Save(Response.OutputStream, ImageFormat.Jpeg) i
do not get this error


Exception Details: System.Runtime.InteropServices.ExternalException: A
generic error occurred in GDI+.

Source Error:


Line 62: string fileName = "PieChart.Jpeg";
Line 63: // Save the image to a file
Line 64: objBitmap.Save( sPath + fileName /*Response.OutputStream*/,
ImageFormat.Jpeg);
Line 65:
Line 66: // clean up...

Source File:
j:\inetpub\wwwroot\piechartwebapplication1\piechartwebform.aspx.cs Line:
64

Stack Trace:

[ExternalException (0x80004005): A generic error occurred in GDI+.]
System.Drawing.Image.Save(String filename, ImageCodecInfo encoder,
EncoderParameters encoderParams)
System.Drawing.Image.Save(String filename, ImageFormat format)
PieChartWebApplication1.PieChartWebForm.Page_Load(Object sender,
EventArgs e) in
j:\inetpub\wwwroot\piechartwebapplication1\piechartwebform.aspx.cs:64
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731


TIA

Barry
 
Ad

Advertisements

Ad

Advertisements

B

Barry

Hi
Note : this is a C# Web application

string sPath = Request.PhysicalApplicationPath.ToString();
string fileName = "PieChart.Jpeg";
// Save the image to a file
objBitmap.Save( sPath + fileName /*Response.OutputStream*/,
ImageFormat.Jpeg);

TIA
Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top