ArgumentException is thrown when trying to create an Image from the stream produced by ImageExporter...


ArgumentException is thrown when trying to create an Image from the...
Author
Message
Irina
Irina
Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)
Group: Forum Members
Posts: 23, Visits: 306
Hello,
I need to export a chart control to EMF image without saving it to a file. The following code fails with System.ArgumentException when Image.FromStream is called.

var memoryStream = new MemoryStream();
nChartControl1.ImageExporter.SaveToStream(memoryStream, new NSize(500, 500), NResolution.ScreenResolution,  new NEmfImageFormat());
var image = Image.FromStream(memoryStream);

What is the cause of the exception and how it can be prevented?
Thank you


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search