By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,953 Members | 1,610 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,953 IT Pros & Developers. It's quick & easy.

Image Save Error

P: n/a
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\piechar twebform.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\piechar twebform.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

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
What is the value of sPath?

Nov 17 '05 #2

P: n/a
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

"The Other Nice Man" <ot**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
What is the value of sPath?

Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.