I’m running into an issue when trying to save a Chart as a PNG file to a temp file path. I’ve tried a few different ImageOrPrintOptions with no luck. Other charts are saving fine. Is there something else I need to do?
var imagePrintOptions = new Aspose.Cells.Rendering.ImageOrPrintOptions
{
ImageFormat = ImageFormat.Png,
ChartImageType = ImageFormat.Png
};
c.ToImage(tempImagePath, imagePrintOptions);
Here’s the exception that gets raised:
-
at .( )aexc { : Bad state (unknown compression method (0x00))
at .( )
at .Read(Byte[] , Int32 , Int32 )
at .Read(Byte[] , Int32 , Int32 )
at .(Boolean , Boolean , Int32 , Int32 , Int32 , Byte[] , Int32 )
at .()
at Aspose.Cells.Drawing.Picture.get_Data()
at .(Picture )
at . ( , )
at . ( , Boolean )
at .( )
at . ()
at . ()
at .(Stream , Chart )
at Aspose.Cells.Charts.Chart.ToImage(Stream stream, ImageOrPrintOptions options)
at Aspose.Cells.Charts.Chart.ToImage(String imageFile, ImageOrPrintOptions options)