TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

ApiStroke

new ApiStroke()

Class representing a stroke.

Methods

Name Description
GetClassType

Returns a type of the ApiStroke class.

ToJSON

Converts the ApiStroke object into the JSON object.

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oRGBColor = Api.CreateRGBColor(255, 111, 61);
var oFill = Api.CreateSolidFill(oRGBColor);
var oStroke = Api.CreateStroke(5 * 36000, Api.CreateSolidFill(Api.CreateRGBColor(51, 51, 51)));
var oDrawing = Api.CreateShape("roundRect", 5930900, 395605, oFill, oStroke);
oParagraph.AddDrawing(oDrawing);
var sClassType = oStroke.GetClassType();
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Class Type = " + sClassType);
oDocument.Push(oParagraph);
builder.SaveFile("docx", "ApiStroke.docx");
builder.CloseFile();

Resulting document