Page 1 of 1

export chart in png format into Response.OutputStream

Posted: Tue Jul 26, 2005 2:15 am
by 8125091
I have an asp.net application

when i export WebChart image in jpeg format into response.OutputStream
it works fine

Code: Select all

private void Button1_Click(object sender, System.EventArgs e)
		{

		    webChart.Chart.Export.Image.JPEG.Save(System.Web.HttpContext.Current.Response.OutputStream);

		}
but when i'm trying to export WebChart image in png format into response.OutputStream

Code: Select all

		private void Button1_Click(object sender, System.EventArgs e)
		{

		    webChart.Chart.Export.Image.PNG.Save(System.Web.HttpContext.Current.Response.OutputStream);

		}
I receive error
"A generic error occurred in GDI+."

also when I export image not in Response.OutputStream but in a file
it works fine in both cases: with JPEG format and PNG format

thank you

Posted: Tue Jul 26, 2005 9:56 am
by narcis
Hi synapcent,

You could try doing something like what's done in the "Chart as Image" example at our on-line demo which includes source code example. The example is List of Features -> Interacting with Charts -> Chart as Image.