How to make a gradient fill symbol


Summary
This article show the steps necessary to create a Gradient Fill Symbol that is based on an algorithmic color ramp.

Making a gradient fill symbol

A gradient fill symbol is used for drawing a color ramp within the limits of the filled area. The GradientAngle controls the orientation of the gradient in the fill. The GradientPercentage controls the saturation and IntervalCount of the number of displayed colors.
The following code shows the steps for creating a gradient fill using an AlgorithmicColorRamp:
[Java]
static void gradientFillSymbol()throws Exception{
    // Create the from color for the IAlgorithmicColorRamp
    IRgbColor startRgbColor = new RgbColor();
    startRgbColor.setRed(255);
    startRgbColor.setGreen(255);
    startRgbColor.setBlue(0);

    // Create the to color for the IAlgorithmicColorRamp
    IRgbColor endRgbColor = new RgbColor();
    endRgbColor.setRed(255);
    endRgbColor.setGreen(0);
    endRgbColor.setBlue(0);

    // Create the Ramp for the Gradient Fill
    IAlgorithmicColorRamp colorRamp = new AlgorithmicColorRamp();
    colorRamp.setFromColor(startRgbColor);
    colorRamp.setToColor(endRgbColor);
    colorRamp.setAlgorithm(esriColorRampAlgorithm.esriHSVAlgorithm);

    // Create the Gradient Fill
    IGradientFillSymbol gradient = new GradientFillSymbol();
    gradient.setColorRamp(colorRamp);
    gradient.setGradientAngle(45);
    gradient.setGradientPercentage(0.9);
    gradient.setIntervalCount(15);
    gradient.setStyle(esriGradientFillStyle.esriGFSLinear);
}


See Also:

How to make a cartographic line symbol
How to make a character marker symbol
How to make a line callout
How to make a line fill symbol
How to make a picture marker symbol
How to make different types of colors




Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine