double k = 0;
IMap pMap = axMapControl1.Map;
IActiveView pActiveview = pMap as IActiveView;
IPoint pPoint = pActiveview.ScreenDisplay.DisplayTransformation.ToMapPoint(e.x, e.y);
ITopologicalOperator pTopolog = pPoint as ITopologicalOperator;
IGeometry pGeo = pPoint as IGeometry;
k = Convert.ToDouble(textBox8.Text);
pGeo = pTopolog.Buffer(k);
IRgbColor pRgb = new RgbColorClass();
pRgb.RGB = 255;
IColor pColor = pRgb;
ISimpleFillSymbol pSimfillsym = new SimpleFillSymbolClass();
pSimfillsym.Color = pRgb;
ISymbol pSymbol = pSimfillsym as ISymbol;
pActiveview.ScreenDisplay.SetSymbol(pSymbol);
pActiveview.ScreenDisplay.DrawPolygon(pGeo);
pMap.SelectByShape(pGeo, null, false);
axMapControl1.DrawShape(pGeo);
axMapControl1.ActiveView.Refresh();
ISpatialFilter pSpatialFilter = new SpatialFilterClass();
pSpatialFilter.Geometry = pGeo;
IFeatureLayer pFeatureLayer = null;
IFeature pFeature = null;
IEnumIDs pEnumid = null;
pFeatureLayer = this.axMapControl1.get_Layer(1) as IFeatureLayer;
if (pFeatureLayer.Visible)
{
IFeatureSelection pFeatureSelection = pFeatureLayer as IFeatureSelection;
ISelectionSet pSelection = pFeatureSelection.SelectionSet;
if (pSelection.Count > 0)
{
long id = pSelection.Count;
pEnumid = pSelection.IDs;
id = pEnumid.Next();
pFeature = pFeatureLayer.FeatureClass.GetFeature((int)id);
for (i = 0; i < pFeature.Fields.FieldCount; i++)
{
textBValues.Text = pFeature.Fields.get_Field(i).Name + ":" + pFeature.get_Value(i).ToString();
pFeatureSelection.Clear();
}
}
这是我的代码,但这只能显示一个点的信息,怎样将包含在内的所有点信息都显示