How to make a line fill symbol


Summary
The code in this topic shows how to make a line fill symbol.

Making a line fill symbol

Line fill symbols are used to draw fill internally composed of one or more line symbols. Any type of line symbol that is supported by the ILineSymbol interface can be used.
The following code example shows how to make a line fill that uses ICartographicLineSymbol as the internal fill:
[VB.NET]
Public Sub LineFillSymbol()
    ' Set the color for the line symbol in the fill.
    Dim rgbColorCls As ESRI.ArcGIS.Display.IRgbColor = New ESRI.ArcGIS.Display.RgbColorClass
    With rgbColorCls
        .Red = 138
        .Green = 151
        .Blue = 255
    End With
    
    ' Create the line symbol to be used.
    Dim cartographicLineSymbolCls As ESRI.ArcGIS.Display.ICartographicLineSymbol = New ESRI.ArcGIS.Display.CartographicLineSymbolClass
    With cartographicLineSymbolCls
        .Cap = ESRI.ArcGIS.Display.esriLineCapStyle.esriLCSButt
        .Join = ESRI.ArcGIS.Display.esriLineJoinStyle.esriLJSMitre
        .Color = rgbColorCls
        .Width = 2
    End With
    
    ' Create the line fill symbol.
    Dim lineFillSymbolCls As ESRI.ArcGIS.Display.ILineFillSymbol = New ESRI.ArcGIS.Display.LineFillSymbolClass
    With lineFillSymbolCls
        .Angle = 45
        .Separation = 10
        .Offset = 5
    End With
    
    lineFillSymbolCls.LineSymbol = cartographicLineSymbolCls
    
End Sub
[C#]
public void LineFillSymbol()
{
    // Set the color for the line symbol in the fill.
    ESRI.ArcGIS.Display.IRgbColor rgbColorCls = new
        ESRI.ArcGIS.Display.RgbColorClass();
    rgbColorCls.Red = 138;
    rgbColorCls.Green = 151;
    rgbColorCls.Blue = 255;

    // Create the line symbol to be used.
    ESRI.ArcGIS.Display.ICartographicLineSymbol cartographicLineSymbolCls = new
        ESRI.ArcGIS.Display.CartographicLineSymbolClass();
    cartographicLineSymbolCls.Cap = ESRI.ArcGIS.Display.esriLineCapStyle.esriLCSButt;
    cartographicLineSymbolCls.Join =
        ESRI.ArcGIS.Display.esriLineJoinStyle.esriLJSMitre;
    cartographicLineSymbolCls.Color = rgbColorCls;
    cartographicLineSymbolCls.Width = 2;

    // Create the line fill symbol.
    ESRI.ArcGIS.Display.ILineFillSymbol lineFillSymbolCls = new
        ESRI.ArcGIS.Display.LineFillSymbolClass();
    lineFillSymbolCls.Angle = 45;
    lineFillSymbolCls.Separation = 10;
    lineFillSymbolCls.Offset = 5;
    lineFillSymbolCls.LineSymbol = cartographicLineSymbolCls;
}


See Also:

How to make a cartographic line symbol
How to make a character marker symbol
How to make a gradient fill symbol
How to make a line callout
How to make a picture marker symbol
Creating custom symbols
Creating other kinds of custom symbols
How to make different types of colors and color ramps




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced
Engine Developer Kit Engine