Image Save Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Barry

    Image Save Error

    Hi

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


    Exception Details: System.Runtime. InteropServices .ExternalExcept ion: 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.Outpu tStream*/,
    ImageFormat.Jpe g);
    Line 65:
    Line 66: // clean up...

    Source File:
    j:\inetpub\wwwr oot\piechartweb application1\pi echartwebform.a spx.cs Line:
    64

    Stack Trace:

    [ExternalExcepti on (0x80004005): A generic error occurred in GDI+.]
    System.Drawing. Image.Save(Stri ng filename, ImageCodecInfo encoder,
    EncoderParamete rs encoderParams)
    System.Drawing. Image.Save(Stri ng filename, ImageFormat format)
    PieChartWebAppl ication1.PieCha rtWebForm.Page_ Load(Object sender,
    EventArgs e) in
    j:\inetpub\wwwr oot\piechartweb application1\pi echartwebform.a spx.cs:64
    System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
    System.Web.UI.C ontrol.LoadRecu rsive() +35
    System.Web.UI.P age.ProcessRequ estMain() +731


    TIA

    Barry



  • The Other Nice Man

    #2
    Re: Image Save Error

    What is the value of sPath?

    Comment

    • Barry

      #3
      Re: Image Save Error

      Hi
      Note : this is a C# Web application

      string sPath = Request.Physica lApplicationPat h.ToString();
      string fileName = "PieChart.Jpeg" ;
      // Save the image to a file
      objBitmap.Save( sPath + fileName /*Response.Outpu tStream*/,
      ImageFormat.Jpe g);

      TIA
      Barry

      "The Other Nice Man" <otherniceman@g mail.com> wrote in message
      news:1117717879 .611221.323720@ z14g2000cwz.goo glegroups.com.. .[color=blue]
      > What is the value of sPath?
      >[/color]


      Comment

      Working...