ApiDrawing

new ApiDrawing()

Class representing a graphical object.

Methods

Name Description
GetClassType

Returns a type of the ApiDrawing class.

GetHeight

Returns the height of the current drawing.

GetLockValue

Returns the lock value for the specified lock type of the current drawing.

GetWidth

Returns the width of the current drawing.

SetLockValue

Sets the lock value to the specified lock type of the current drawing.

SetPosition

Changes the position for the drawing object. Please note that the horizontal and vertical offsets are calculated within the limits of the specified column and row cells only. If this value exceeds the cell width or height, another vertical/horizontal position will be set.

SetSize

Sets a size of the object (image, shape, chart) bounding box.

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFill = Api.CreateSolidFill(Api.CreateRGBColor(255, 111, 61));
var oStroke = Api.CreateStroke(0, Api.CreateNoFill());
var oDrawing = oWorksheet.AddShape("flowChartOnlineStorage", 60 * 36000, 35 * 36000, oFill, oStroke, 0, 2 * 36000, 0, 3 * 36000);
oDrawing.SetSize(80 * 36000, 40 * 36000);
oDrawing.SetPosition(0, 2 * 36000, 2, 3 * 36000);
var sClassType = oDrawing.GetClassType();
oWorksheet.GetRange("A1").SetValue("Class Type = " + sClassType);
builder.SaveFile("xlsx", "ApiDrawing.xlsx");
builder.CloseFile();

Resulting document