Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
110
Retrieve Image from WorksheetChart
posted

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