Skip to main content

IXlPicture.SetOneCellAnchor(XlAnchorPoint, Int32, Int32) Method

Anchors an IXlPicture object to a specific cell in a worksheet.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v23.2.Core.dll

NuGet Package: DevExpress.Printing.Core

Declaration

void SetOneCellAnchor(
    XlAnchorPoint topLeft,
    int width,
    int height
)

Parameters

Name Type Description
topLeft XlAnchorPoint

An XlAnchorPoint object that specifies the anchor cell for the top-left corner of the picture and optional offsets from the top and left edges of this cell.

width Int32

A Int32 value that is the desired width of the picture in pixels.

height Int32

A Int32 value that is the desired height of the picture in pixels.

Remarks

Use the SetOneCellAnchor method to specify the start position for a picture in a worksheet. The top-left corner of the picture will be anchored to a specific cell whose position in a worksheet is defined by the XlAnchorPoint object. This object specifies the column and row containing the anchor cell and allows you to define possible offsets within this cell to move the picture away from the top-left corner of the anchor cell. The IXlPicture.AnchorType for the inserted picture will be set to XlAnchorType.OneCell. The picture will move with the anchor cell, but its size will remain the same.

For more information on how to add a picture to a worksheet and specify its location, refer to the How to: Insert and Position a Picture in a Worksheet example.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SetOneCellAnchor(XlAnchorPoint, Int32, Int32) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also