[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IShapes.AddShapeInPixel

AddShapeInPixel Method

AddShapeInPixel(AutoShapeType, double, double, double, double)

Creates a new preset shape in the worksheet using pixel-based position and size.

This method returns the IShape object that represents the new preset shape. The specified pixel values are converted to points before the shape is created.

Declaration
IShape AddShapeInPixel(AutoShapeType type, double left, double top, double width, double height)
Function AddShapeInPixel(type As AutoShapeType, left As Double, top As Double, width As Double, height As Double) As IShape
Parameters
Type Name Description
AutoShapeType type

Specifies the type of preset shape to create.

double left

The position, in pixels, of the upper-left corner of the preset shape's boundary box relative to the upper-left corner of the document.

double top

The position, in pixels, of the upper-left corner of the preset shape's boundary box relative to the upper-left corner of the document.

double width

The width of the preset shape's boundary box, in pixels.

double height

The height of the preset shape's boundary box, in pixels.

Returns
Type Description
IShape

The IShape object that represents the new preset shape.

Examples
IShape shape = worksheet.Shapes.AddShapeInPixel(
    AutoShapeType.Rectangle, 20, 30, 120, 60);
shape.Name = "ProcessBox";

AddShapeInPixel(string, AutoShapeType, double, double, double, double)

Creates a preset shape with the specified name at the specified location on the worksheet.

The shape position and size are measured in pixels. The left and top values specify the position of the upper-left corner of the preset shape's boundary box relative to the upper-left corner of the document.

Declaration
IShape AddShapeInPixel(string name, AutoShapeType type, double left, double top, double width, double height)
Function AddShapeInPixel(name As String, type As AutoShapeType, left As Double, top As Double, width As Double, height As Double) As IShape
Parameters
Type Name Description
string name

The shape name.

AutoShapeType type

Specifies the type of preset shape to create.

double left

The position, in pixels, of the upper-left corner of the preset shape's boundary box relative to the upper-left corner of the document.

double top

The position, in pixels, of the upper-left corner of the preset shape's boundary box relative to the upper-left corner of the document.

double width

The width of the preset shape's boundary box, in pixels.

double height

The height of the preset shape's boundary box, in pixels.

Returns
Type Description
IShape

The IShape object that represents the new preset shape.

Examples
IShape shape = worksheet.Shapes.AddShapeInPixel(
    "ProcessBox", AutoShapeType.Rectangle, 24, 36, 160, 90);
shape.AlternativeText = "Review step";