export chart in png format into Response.OutputStream

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Joe
Newbie
Newbie
Posts: 12
Joined: Thu Apr 15, 2004 4:00 am

export chart in png format into Response.OutputStream

Post by Joe » Tue Jul 26, 2005 2:15 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Jul 26, 2005 9:56 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply