We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert Memory Stream Image into Cell Aspose.Cells

I have searched the formums and not able to find any articles on how to insert an image from a memory stream into an Excel cell using Asopose.Cells.

Can you provide and example with code?

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please see the following sample code to add picture / image into excel worksheet using stream.

//Instantiating a Workbook object

Workbook workbook = new Workbook();

//Obtaining the reference of the newly added worksheet by passing its sheet index

Worksheet worksheet = workbook.Worksheets[0];

FileStream stream = new FileStream("C:\\17820_logo.jpg", FileMode.Open, FileAccess.Read);

int indexPicture = worksheet.Pictures.Add(5, 5, stream);

Aspose.Cells.Picture picture = worksheet.Pictures[indexPicture];

picture.Placement = PlacementType.Move;

//Saving the Excel file

workbook.Save("C:\\book1.xls");

Thank You & Best Regards,