Load images with aspose

Hi everybody!


I’m traying to read a Excel file, in which there are images, that images should be saved in a repository, its possible read images with Aspose?

Hi,

Thanks for your posting and considering Aspose.Cells.

Please see the following sample code for your needs. I have attached the sample excel file used in this code and the extracted images via this code for your reference.

I have tested this code with the latest version:
Aspose.Cells for .NET v8.9.0.9.

C#

//Load your workbook containing pictures
Workbook wb = new Workbook(“sample.xlsx”);

//Access your first worksheet which contains the pictures
Worksheet ws = wb.Worksheets[0];

//Access pictures one by one and save them on disk
for(int i=0; i<ws.Pictures.Count; i++)
{
Picture pic = ws.Pictures[i];
File.WriteAllBytes(“picture-” + i + “.”+ pic.ImageFormat.ToString().ToLower(), pic.Data);
}