Click or drag to resize

ExcelPictureCollectionAdd Method (String, AnchorCell, AnchorCell, ExcelObjectSourceType)

Adds a new picture to the worksheet which moves and sizes with cells.

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 43.0.35.1049
Syntax
public ExcelPicture Add(
	string picturePath,
	AnchorCell positionFrom,
	AnchorCell positionTo,
	ExcelObjectSourceType sourceType
)

Parameters

picturePath
Type: SystemString
The picture's path.
positionFrom
Type: GemBox.SpreadsheetAnchorCell
The picture's position (top-left corner).
positionTo
Type: GemBox.SpreadsheetAnchorCell
The picture's end position (bottom-right corner).
sourceType
Type: GemBox.SpreadsheetExcelObjectSourceType
the picture's embedding or linking setting.

Return Value

Type: ExcelPicture
A new picture added to the worksheet which moves and sizes with cells.
Remarks

Position.Mode of a newly added picture will be MoveAndSize.

picturePath parameter must contain supported extension (for example, ".png"), otherwise exception is thrown.

See Also