private IMarkerFillSymbol CreatMarkerFillSymbol(IMarkerSymbol pMarkerSymbol, ILineSymbol pLineSymbol, IColor pColor, double xoffset, double yoffset, double xsept, double ysept) { IMarkerFillSymbol pMFillSymbol = new MarkerFillSymbolClass(); IFillProperties pFillProp = new MarkerFillSymbolClass(); pFillProp.XOffset = xoffset; pFillProp.YOffset = yoffset; pFillProp.XSeparation = xsept; pFillProp.YSeparation = ysept; pMFillSymbol = pFillProp as IMarkerFillSymbol; pMFillSymbol.MarkerSymbol = pMarkerSymbol; pMFillSymbol.Outline = pLineSymbol; pMFillSymbol.Color = pColor; pMFillSymbol.Style = esriMarkerFillStyle.esriMFSGrid; return(pMFillSymbol); }
//MarkerFillSymbol private void button14_Click(object sender, EventArgs e) { IArrowMarkerSymbol arrowMarkerSymbol = new ArrowMarkerSymbolClass(); IRgbColor rgbColor = getRGB(255, 0, 0); arrowMarkerSymbol.Color = rgbColor as IColor; arrowMarkerSymbol.Length = 10; arrowMarkerSymbol.Width = 10; arrowMarkerSymbol.Style = esriArrowMarkerStyle.esriAMSPlain; IMarkerFillSymbol markerFillSymbol = new MarkerFillSymbolClass(); markerFillSymbol.MarkerSymbol = arrowMarkerSymbol; rgbColor = getRGB(0, 255, 0); markerFillSymbol.Color = rgbColor; markerFillSymbol.Style = esriMarkerFillStyle.esriMFSGrid; IFillProperties fillProperties = markerFillSymbol as IFillProperties; fillProperties.XOffset = 2; fillProperties.YOffset = 2; fillProperties.XSeparation = 15; fillProperties.YSeparation = 20; 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(markerFillSymbol as ISymbol); activeView.ScreenDisplay.DrawPolygon(polygon as IGeometry); activeView.ScreenDisplay.FinishDrawing(); }