[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IBackgroundPictures

IBackgroundPictures Interface

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.

Namespace: GrapeCity.Documents.Excel.Drawing
Assembly: DS.Documents.Excel.dll
Syntax
public interface IBackgroundPictures : IEnumerable<IBackgroundPicture>, IEnumerable
Public Interface IBackgroundPictures
    Inherits IEnumerable(Of IBackgroundPicture), IEnumerable
Examples
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"];

Properties

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 index parameter to retrieve a background picture by its position in the IBackgroundPictures collection.

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.

Methods

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 left and top parameters specify the upper-left corner of the destination rectangle relative to the upper-left corner of the document.

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.