asposediagram.api

Class GradientFill

Represents the gradient fill.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("ShapewithGradientFill.vsdx");

// get page by name
page = diagram.getPages().getPage("Page-1");
// get shape by ID
shape = page.getShapes().getShape(1);
// get the gradient fill properties
gradientfill = shape.getFill().getGradientFill();
// get the gradient stops
stops = gradientfill.getGradientStops();
// get the gradient stop by index
stop = stops.get(0);
// set gradient stop properties
stop.getColor().getUfe().setF("");
stop.getPosition().setValue(0.5);
gradientfill.getGradientDir().setValue(aspose.diagram.GradientFillDir.RECTANGLE_FROM_BOTTOM_RIGHT);
gradientfill.getGradientAngle().setValue(0.7853981633974501);

diagram.save("out-ShapewithGradientFill.vsdx", aspose.diagram.SaveFileFormat.VSDX);

Property Getters/Setters Summary
methodgetGradientAngle()
method
           Specifies the orientation of the fill color gradient
methodgetGradientDir()
method
           Specifies the type of the fill color gradient
methodgetGradientEnabled()
method
           Specifies whether the fill color gradient is visible.
methodgetGradientStops()
Represents the gradient stop collection.
 

    • Property Getters/Setters Detail

      • getGradientDir/setGradientDir : IntValue 

        IntValue getGradientDir() / setGradientDir(value)
        
        Specifies the type of the fill color gradient
      • getGradientAngle/setGradientAngle : DoubleValue 

        DoubleValue getGradientAngle() / setGradientAngle(value)
        
        Specifies the orientation of the fill color gradient
      • getGradientEnabled/setGradientEnabled : BoolValue 

        BoolValue getGradientEnabled() / setGradientEnabled(value)
        
        Specifies whether the fill color gradient is visible.