Back to Devexpress

PictureCollection.AddPicture(String, CellRange, Boolean) Method

officefileapi-devexpress-dot-spreadsheet-dot-picturecollection-dot-addpicture-x28-system-dot-string-devexpress-dot-spreadsheet-dot-cellrange-system-dot-boolean-x29.md

latest2.4 KB
Original Source

PictureCollection.AddPicture(String, CellRange, Boolean) Method

Inserts a picture from a file to fit in the specified range allowing you to lock the aspect ratio.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
Picture AddPicture(
    string filename,
    CellRange targetRange,
    bool lockAspectRatio
)
vb
Function AddPicture(
    filename As String,
    targetRange As CellRange,
    lockAspectRatio As Boolean
) As Picture

Parameters

NameTypeDescription
filenameString

A string that specifies a path to the image file.

| | targetRange | CellRange |

A CellRange to which the inserted picture fits.

| | lockAspectRatio | Boolean |

true , to lock the aspect ratio; otherwise, false.

|

Returns

TypeDescription
Picture

A Picture object that is the inserted picture.

|

Remarks

The inserted picture has FloatingObject.Placement set to Placement.MoveAndSize.

See Also

Charts and Graphics in Spreadsheet Documents

How to: Insert and Delete Pictures

PictureCollection Interface

PictureCollection Members

DevExpress.Spreadsheet Namespace