/// <summary> /// getLineFillSymbol /// </summary> /// <param name="color">color</param> /// <param name="angle">angle</param> /// <param name="offset">offset</param> /// <param name="separation">separation</param> /// <param name="linesymbol">linesymbol</param> /// <param name="outline">outline</param> /// <returns>ILineFillSymbol</returns> public ILineFillSymbol getLineFillSymbol( IRgbColor color = null, double angle = 60, double offset = 1, double separation = 1, ILineSymbol linesymbol = null, ILineSymbol outline = null) { ILineFillSymbol lineFillSymbol = new LineFillSymbol(); if (color == null) { color = getRGB(210, 36, 240) as IRgbColor; } if (linesymbol == null) { linesymbol = CreateSimpleLineSymbol(getRGB(55, 90, 180) as IRgbColor, 2, esriSimpleLineStyle.esriSLSDot); } if (outline == null) { outline = CreateSimpleLineSymbol(getRGB(155, 190, 180) as IRgbColor, 3, esriSimpleLineStyle.esriSLSDash); } lineFillSymbol.Color = color; lineFillSymbol.Angle = angle; lineFillSymbol.Offset = offset; lineFillSymbol.Separation = separation; lineFillSymbol.Outline = outline; lineFillSymbol.LineSymbol = linesymbol; return(lineFillSymbol); }
//MultilayerFillSymbol private void button17_Click(object sender, EventArgs e) { IMultiLayerFillSymbol multiLayerFillSymbol = new MultiLayerFillSymbolClass(); IGradientFillSymbol gradientFillSymbol = new GradientFillSymbolClass(); IAlgorithmicColorRamp algorithcColorRamp = new AlgorithmicColorRampClass(); algorithcColorRamp.FromColor = getRGB(255, 0, 0); algorithcColorRamp.ToColor = getRGB(0, 255, 0); algorithcColorRamp.Algorithm = esriColorRampAlgorithm.esriHSVAlgorithm; gradientFillSymbol.ColorRamp = algorithcColorRamp; gradientFillSymbol.GradientAngle = 45; gradientFillSymbol.GradientPercentage = 0.9; gradientFillSymbol.Style = esriGradientFillStyle.esriGFSLinear; ICartographicLineSymbol cartoLine = new CartographicLineSymbol(); cartoLine.Cap = esriLineCapStyle.esriLCSButt; cartoLine.Join = esriLineJoinStyle.esriLJSMitre; cartoLine.Color = getRGB(255, 0, 0); cartoLine.Width = 2; //Create the LineFillSymbo ILineFillSymbol lineFill = new LineFillSymbol(); lineFill.Angle = 45; lineFill.Separation = 10; lineFill.Offset = 5; lineFill.LineSymbol = cartoLine; multiLayerFillSymbol.AddLayer(gradientFillSymbol); multiLayerFillSymbol.AddLayer(lineFill); object Missing = Type.Missing; IPolygon polygon = new PolygonClass(); IPointCollection pointCollection = polygon as IPointCollection; IPoint point = new PointClass(); point.PutCoords(5, 5); pointCollection.AddPoint(point, ref Missing, ref Missing); point.PutCoords(5, 10); pointCollection.AddPoint(point, ref Missing, ref Missing); point.PutCoords(10, 10); pointCollection.AddPoint(point, ref Missing, ref Missing); point.PutCoords(10, 5); pointCollection.AddPoint(point, ref Missing, ref Missing); polygon.SimplifyPreserveFromTo(); IActiveView activeView = this.axMapControl1.ActiveView; activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache); activeView.ScreenDisplay.SetSymbol(multiLayerFillSymbol as ISymbol); activeView.ScreenDisplay.DrawPolygon(polygon as IGeometry); activeView.ScreenDisplay.FinishDrawing(); }
public static ISymbol CreateLineFillSymbol(Color fillColor, int oLineWidth, esriSimpleFillStyle fillStyle) { ILineFillSymbol pLineFillSymbol; pLineFillSymbol = new LineFillSymbol(); pLineFillSymbol.LineSymbol = (ILineSymbol)CreateSimpleLineSymbol(Color.Yellow, 1, esriSimpleLineStyle.esriSLSSolid); pLineFillSymbol.Separation = 5; pLineFillSymbol.Color = GetColor(fillColor.R, fillColor.G, fillColor.B); pLineFillSymbol.Outline = (ILineSymbol)CreateSimpleLineSymbol(fillColor, 2, esriSimpleLineStyle.esriSLSSolid); return((ISymbol)pLineFillSymbol); }
//LineFillSymbol private void button13_Click(object sender, EventArgs e) { ICartographicLineSymbol cartoLine = new CartographicLineSymbol(); cartoLine.Cap = esriLineCapStyle.esriLCSButt; cartoLine.Join = esriLineJoinStyle.esriLJSMitre; cartoLine.Color = getRGB(255, 0, 0); cartoLine.Width = 2; //Create the LineFillSymbo ILineFillSymbol lineFill = new LineFillSymbol(); lineFill.Angle = 45; lineFill.Separation = 10; lineFill.Offset = 5; lineFill.LineSymbol = cartoLine; object Missing = Type.Missing; IPolygon polygon = new PolygonClass(); IPointCollection pointCollection = polygon as IPointCollection; IPoint point = new PointClass(); point.PutCoords(5, 5); pointCollection.AddPoint(point, ref Missing, ref Missing); point.PutCoords(5, 10); pointCollection.AddPoint(point, ref Missing, ref Missing); point.PutCoords(10, 10); pointCollection.AddPoint(point, ref Missing, ref Missing); point.PutCoords(10, 5); pointCollection.AddPoint(point, ref Missing, ref Missing); polygon.SimplifyPreserveFromTo(); IActiveView activeView = this.axMapControl1.ActiveView; activeView.ScreenDisplay.StartDrawing(activeView.ScreenDisplay.hDC, (short)esriScreenCache.esriNoScreenCache); activeView.ScreenDisplay.SetSymbol(lineFill as ISymbol); activeView.ScreenDisplay.DrawPolygon(polygon as IGeometry); activeView.ScreenDisplay.FinishDrawing(); }