ARCEngine中符號選擇器的實現
阿新 • • 發佈:2018-12-20
private void axTOCControl1_OnMouseDown(object sender, ITOCControlEvents_OnMouseDownEvent e) { esriTOCControlItem item = esriTOCControlItem.esriTOCControlItemNone; IBasicMap map = null; ILayer layer = null; object other = null; object index = null; this.axTOCControl1.HitTest(e.x, e.y, ref item, ref map, ref layer, ref other, ref index); if (item == esriTOCControlItem.esriTOCControlItemLegendClass) { IFeatureLayer layerS; layerS = layer as IFeatureLayer; ILegendClass plc = new LegendClassClass(); ILegendGroup plg = new LegendGroupClass(); if (other is ILegendGroup) { plg = (ILegendGroup)other; } plc = plg.get_Class((int)index); ISymbol pSym; pSym = plc.Symbol; ISymbolSelector pSymbolSelector = new SymbolSelectorClass(); pSymbolSelector.AddSymbol(pSym); bool b = pSymbolSelector.SelectSymbol(0); if (b) { plc.Symbol = pSymbolSelector.GetSymbolAt(0); } axMapControl1.ActiveView.Refresh(); axTOCControl1.Refresh(); } }