[]
Represents the collection of background pictures on a worksheet or chart sheet.
This interface provides access to the IBackgroundPicture objects associated with a sheet, including retrieving pictures by index or name and obtaining the total number of pictures in the collection.
public interface IBackgroundPictures : IEnumerable<IBackgroundPicture>, IEnumerable
Public Interface IBackgroundPictures
Inherits IEnumerable(Of IBackgroundPicture), IEnumerable
IBackgroundPictures backgroundPictures = worksheet.BackgroundPictures;
using (MemoryStream stream = CreateSampleImageStream())
{
IBackgroundPicture createdPicture = backgroundPictures.AddPicture(stream, ImageType.PNG, 12, 18, 120, 80);
createdPicture.Name = "Watermark";
}
int count = backgroundPictures.Count;
IBackgroundPicture picture = backgroundPictures[0];
IBackgroundPicture namedPicture = backgroundPictures["Watermark"];
| Name | Description |
|---|---|
| Count | Gets the number of IBackgroundPicture objects in this collection. Use this property to determine how many background pictures are currently associated with the worksheet. |
| this[int] | Gets the IBackgroundPicture at the specified index in this collection.
Use the |
| this[string] | Gets the IBackgroundPicture with the specified name from this collection. Use this indexer to retrieve an IBackgroundPicture from the current IBackgroundPictures collection by its name. |
| Name | Description |
|---|---|
| AddPicture(Stream, ImageType, double, double, double, double) | Creates a background picture from an existing stream and returns the newly created IBackgroundPicture object.
Use this method to add a background picture at the specified position and size in points.
The |
| AddPicture(string, double, double, double, double) | Creates a background picture from an existing file and returns the IBackgroundPicture object that represents the new background picture. The picture is positioned and sized by the destination rectangle specified in points relative to the upper-left corner of the document. |
| AddPictureInPixel(Stream, ImageType, double, double, double, double) | Creates a background picture from an existing stream and returns the IBackgroundPicture object that represents the new background picture. The picture is positioned and sized by the destination rectangle specified in pixels relative to the upper-left corner of the document. |
| AddPictureInPixel(string, double, double, double, double) | Creates a background picture from an existing file and returns the IBackgroundPicture object that represents the new background picture. The picture is positioned and sized by the destination rectangle specified in pixels relative to the upper-left corner of the document. |