Skip to main content
.NET Framework 4.5.2+

PictureCollection Interface

A collection of Picture objects.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v23.1.Core.dll


public interface PictureCollection :


The Worksheet.Pictures property returns a PictureCollection object. To add an image to a worksheet, use the PictureCollection.AddPicture method.

The PictureCollection.GetPicturesByName method allows you to obtain all pictures with the specified name in the collection. To find a picture by its unique ID, use the PictureCollection.GetPictureById method.

If a picture belongs to a shape group, it doesn’t appear in the PictureCollection. To obtain such pictures, you can use the ShapeCollection.Flatten method of the Worksheet.Shapes collection. This method returns a collection of all drawing objects contained in a worksheet, including items of shape groups. Use the ShapeType property to filter this collection by type, as shown in the example below.

using System.Linq;
// ...

var pictures = worksheet.Shapes.Flatten()
    .Where(x => x.ShapeType == ShapeType.Picture)

To delete a picture from a worksheet, use the PictureCollection.RemoveAt or Picture.Delete method.

See Also