Hi! I have a problem. When I have add picture on worksheet like this:
Worksheet sheet=excel.Worksheets[0];
sheet.Pictures.Add(5,5,“c:\myPict.gif”);
Console.WriteLine(“Count pictures on the sheet is {0}”,sheet.Pictures.Count);
It write:
>Count pictures on the sheet is 1
It’s ok. But when I adding picture by myself(by my hands in MS Excel), and open it by Aspose - It write:
>Count pictures on the sheet is 0
Why?
Picutures collection only contains images added at run time. It doesn’t return images in your templates.
@zavoloka,
Aspose.Excel is discarded now and is no more available now. A new product Aspose.Cells has replaced it that contains a lot of advanced features to manage drawing objects including pictures. You can now get pictures on the worksheet and save them on disc.
Workbook workbook = new Workbook("SampleWithImages.xlsx");
foreach (Picture picture in workbook.Worksheets[0].Pictures)
{
Console.WriteLine(picture.Name);
ImageOrPrintOptions imageOrPrintOptions = new ImageOrPrintOptions();
imageOrPrintOptions.ImageType = ImageType.Png;
picture.ToImage(picture.Name, imageOrPrintOptions);
}
For more information on managing pictures refer to the following article:
Managing Pictures
Have a free trial version of this product here:
Aspose.Cells for .NET (Latest Version)
A detailed solution is available here that can be used for testing different features of this product.