Get Started
Documentation

CreateRadialGradientFill

CreateRadialGradientFill(aGradientStop) → {ApiFill}

Create a radial gradient fill which allows to fill the object using a selected radial gradient as the object background.

Parameters:

Name Type Description
aGradientStop Array The array of gradient color stops measured in 1000th of percent.

Returns:

Type
ApiFill

Example

Copy code
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oGs1, oGs2, oFill, oStroke, oDrawing, oParagraph;
oParagraph = oDocument.GetElement(0);
oGs1 = Api.CreateGradientStop(Api.CreateRGBColor(255, 224, 204), 0);
oGs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 164, 101), 100000);
oFill = Api.CreateRadialGradientFill([oGs1, oGs2]);
oStroke = Api.CreateStroke(0, Api.CreateNoFill());
oDrawing = Api.CreateShape("rect", 5930900, 395605, oFill, oStroke);
oParagraph.AddDrawing(oDrawing);
builder.SaveFile("docx", "CreateRadialGradientFill.docx");
builder.CloseFile();

Resulting document