[]
Gets the IBackgroundPicture at the specified index in this collection.
Use the index parameter to retrieve a background picture by its position
in the IBackgroundPictures collection.
IBackgroundPicture this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As IBackgroundPicture
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the background picture in the collection. |
IBackgroundPictures backgroundPictures = worksheet.BackgroundPictures;
int count = backgroundPictures.Count;
if (count > 0)
{
IBackgroundPicture picture = backgroundPictures[0];
}
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.
IBackgroundPicture this[string name] { get; }
ReadOnly Default Property Item(name As String) As IBackgroundPicture
| Type | Name | Description |
|---|---|---|
| string | name | Required string. The name for the object. |
IBackgroundPictures backgroundPictures = worksheet.BackgroundPictures;
using (MemoryStream stream = CreateSampleImageStream())
{
backgroundPictures.AddPicture(stream, ImageType.PNG, 12, 18, 120, 80).Name = "Logo";
}
IBackgroundPicture picture = backgroundPictures["Logo"];