How can I get image from Excel?

I must save the image to database from Excel,but I can't read it.
The code like this:

Stream stream = File1.PostedFile.InputStream;
BinaryReader br = new BinaryReader(stream);
byte[] excelByte = br.ReadBytes( (int)stream.Length );

MemoryStream mStream = new MemoryStream(excelByte);
Excel excel = new Excel();
excel.Open(mStream);

Worksheet sheet = excel.Worksheets[0];

I check that --> sheet.Pictures.Count=0

why??


Pictures APIs are used to insert images at run time. It doesn’t get images from templates. Aspose.Excel just load and save images in templates in their raw formats.

thanks for your help...

hello,

if I buy Developer Professional Subscription or others version,than can read image from excel that user upload ??

If yes, what version we need, and the price is ???

Currently this feature is not supported. We will add it in the future release. The estimated arrival date will be July 15.

@amao9,
Aspose.Cells has replaced Aspose.Excel that is not continued now. You can work will all types of drawing objects using Aspose.Cells like OleObjects, smart art, comments, controls, picture, active X, text boxes and shapes etc. You can get images from Excel file now as demonstrated in the following sample code:

Workbook workbook = new Workbook("Book.xlsx");
foreach (Worksheet worksheet in workbook.Worksheets)
{
    foreach (Picture picture in worksheet.Pictures)
    {
        ImageOrPrintOptions imageOrPrintOptions = new ImageOrPrintOptions();
        imageOrPrintOptions.ImageType = ImageType.Png;
        Console.WriteLine($"{worksheet.Name}-" + picture.Name + ".png");
        picture.ToImage($"{worksheet.Name}-" + picture.Name + ".png", imageOrPrintOptions);

    }
}

This code will parse through all the worksheets in a workbook and save all images on each worksheet as PNG image.

Here is link to a document containing examples and details about working with pictures:
Managing Pictures

You can download the latest free trial version of this product here:
Aspose.Cells for .NET (Latest Version)

A ready-to-run solution is available here to test the new product features.