Free Support Forum - aspose.com

OLE Image outline size after updating the OLE data

Hello Team,

With the previous instruction, we were able to successfully load a thumbnail of an OLE image on the VISIO. However, the default outline size is too small and not readable when compare to the image size after opening it with the actual excel and saving into VISIO. I have attached two compared images side by side for your understanding.

DrawingBeforeandAfterwithOLE.png (78.2 KB)
Question here is how can I set correct width and height of an OLE preview so it can be better readable with more outlined in size by default without even opening and closing the OLE excel?

@Gsunbinary

Can you please also share the sample source files and code snippet so that we can test the scenario in our environment and address it accordingly?

1 Like

@asad.ali

Please find the attached sample project zip file.
DrawingSample.zip (2.2 MB)

Note: Used trial version with this sample project, but we have already purchased full version of Aspose for .Net, but the result are same.

Regards,
George

@Gsunbinary

We have logged a ticket as DIAGRAMNET-52038 in our issue tracking system in order to investigate your requirements. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

@asad.ali

Thank you for the update.

@Gsunbinary

Please try to use the below code snippet:

MemoryStream emfM = new MemoryStream();
ImageOrPrintOptions imgOpt = new ImageOrPrintOptions {
OnePagePerSheet = true,
ImageType = Aspose.Cells.Drawing.ImageType.Emf,
OnlyArea = true,
IsCellAutoFit = true,
};
SheetRender sr = new SheetRender(workbook.Worksheets[0], imgOpt);
sr.ToImage(0, emfM); 

@asad.ali

Thank you very much! It works like a charm.

Regards,
George

1 Like