Convert a Shape/Chart to an image

Posted by: a39377 on 20 April 2019, 1:02 am EST

  • Posted 20 April 2019, 1:02 am EST


    I been reading a lot of documentation, and doesn't seem possible to convert a Shape directly to an image. I can do it with extra steps(save the created chart into a file and then reading it with excel interop) but that is of course an overkill.
    Is really not possible convert directly a chart into a .png or other format, or im missing something?

    Thank you,
  • Replied 21 April 2019, 11:59 pm EST


    As we understand, you would like to export the Chart/Shapes objects presented in the Excel file to the Image Format and not the complete excel file containing Chart/Shapes object(s).
    Please confirm your requirement, so that we may assist you ahead!

  • Replied 22 April 2019, 8:36 pm EST


    Yes, that's exactly right. I want to convert a chart into an image (eventually to be converted into a byte[] and then string). this is my code:

    var workbook = input.Workbook; //this is the workbook

    var worksheet = input.Workbook.Worksheets[0]; // get the first worksheet

    var shape = worksheet.Shapes.First(); // the first chart

    var image = shape...// code to covert to an image

    Thank you for the reply and my apologies for the lack of clarification.
  • Replied 24 April 2019, 3:18 pm EST


    Thanks for clarification.
    I am discussing your requirement with the developers [ID:959] and will get back to you once I have some information for you.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels