creating an image file from a chart with hotspots
Posted: Wed Feb 01, 2012 4:01 pm
Hi everyone.
Sandra might remember this thread since some time back. I had a problem creating something downloadable out of a gantt chart containing several series and hotspots. I found this solution, that worked fine on my laptop:
__________________________
//Create image:
var ChartImg1 : BitMap := new Bitmap(webChart1.Chart.Width,webChart1.Chart.Height);
ChartImg1:=webChart1.Chart.Bitmap(width,height);
webChart1.PictureFormat:=PictureFormats.JPEG;
Response.ContentType := "image/jpeg";
ChartImg1.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
______________________________________________
I've been doing very different things for a while, and haven't come around to deploying it to the server until now, and when I do I get this exception stack trace:
_____________________
[ExternalException (0x80004005): A generic error occurred in GDI+.]
System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) +378002
System.Drawing.Image.Save(Stream stream, ImageFormat format) +36
GanttChart.Page_Load(Object sender, EventArgs e) +3244
______________________
I am using Httphandler as a TempChart and the tag in web.config looks like this (First tag bracket changed for an &) :
&httpHandlers>
&add verb="*" path="TeeChartImgGen.ashx" type="Steema.TeeChart.Web.TeeChartImgGen, TeeChart"/>
&/httpHandlers>
Any ideas, anyone ?
Sandra might remember this thread since some time back. I had a problem creating something downloadable out of a gantt chart containing several series and hotspots. I found this solution, that worked fine on my laptop:
__________________________
//Create image:
var ChartImg1 : BitMap := new Bitmap(webChart1.Chart.Width,webChart1.Chart.Height);
ChartImg1:=webChart1.Chart.Bitmap(width,height);
webChart1.PictureFormat:=PictureFormats.JPEG;
Response.ContentType := "image/jpeg";
ChartImg1.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
______________________________________________
I've been doing very different things for a while, and haven't come around to deploying it to the server until now, and when I do I get this exception stack trace:
_____________________
[ExternalException (0x80004005): A generic error occurred in GDI+.]
System.Drawing.Image.Save(Stream stream, ImageCodecInfo encoder, EncoderParameters encoderParams) +378002
System.Drawing.Image.Save(Stream stream, ImageFormat format) +36
GanttChart.Page_Load(Object sender, EventArgs e) +3244
______________________
I am using Httphandler as a TempChart and the tag in web.config looks like this (First tag bracket changed for an &) :
&httpHandlers>
&add verb="*" path="TeeChartImgGen.ashx" type="Steema.TeeChart.Web.TeeChartImgGen, TeeChart"/>
&/httpHandlers>
Any ideas, anyone ?