Hi,
we are experimenting with retrieving image informations out of an excel file by using infragistics (InfragisticsWPF4.Documents.Excel.v11.2). We are trying to get an image (i.e. a thumbnail) out of an excel file and this is what we have so far:
private BitmapImage GetImage(WorksheetShape shape) { if (shape is WorksheetImage) { WorksheetImage img = shape as WorksheetImage; using(MemoryStream ms = new MemoryStream()) { img.Image.Save(ms, ImageFormat.Png); BitmapImage result = new BitmapImage(); result.BeginInit(); result.StreamSource = new MemoryStream(ms.ToArray()); result.EndInit(); return result; } } else if (shape is WorksheetChart) { //?? }}
As a next step, we would like to extract also chart thumbnails. Is that possible?
Cheers
No, this is currently not possible. The WorksheetChart object currently only exists to allow the developer to see what kind of shape is on the worksheet and to allow them to remove it. You can submit a feature request for the ability to get the chart thumbnail.
I have submitted the feature request. Is there a way to know if it will be implemented?