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

    Hi,

    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

    Hi,

    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!

    Regards,
    Ruchir
  • Replied 22 April 2019, 8:36 pm EST

    Hello,

    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

    Hello,

    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.

    Regards,
    Ruchir
  • Marked as Answer

    Replied 20 August 2019, 2:50 pm EST

    Hi,

    I am happy to inform you that it is now possible to export shapes to image using GcExcel. For information on how to implement this, please refer following demo page: https://demos.componentone.com/gcdocs/gcexcel/GrapeCity.Documents.Excel.Examples.Features.PDFExporting.ConvertShapeToImage

    Regarding exporting charts to image, the team is currently working over the same and it should be available in one of the future release versions. I'll inform you about that too, once it releases.

    Best wishes,
    Ruchir
Need extra support?

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

Learn More

Forum Channels