private void id2ToolStripMenuItem_Click(object sender, EventArgs e)
{
IFeatureLayer pFeatureLayer = axMapControl1.Map.get_Layer(7) as IFeatureLayer;
string sqlfilter = "FID>2";
SearchFeature(sqlfilter, pFeatureLayer);
}
private void SearchFeature(string sqlfilter, IFeatureLayer pFeatureLayer)
{
IFeatureLayer pFeatLyr = pFeatureLayer;
IQueryFilter pFilter = new QueryFilterClass();//定义一个过滤器对象
pFilter.WhereClause = sqlfilter;//添加过滤参数
IFeatureCursor pFeatCursor = pFeatLyr.Search(pFilter, true);
IFeature pFeat = pFeatCursor.NextFeature();
while (pFeat != null)
{
pFeat = pFeatCursor.NextFeature();
if (pFeat != null)
{
ISimpleFillSymbol pFillsyl = new SimpleFillSymbolClass();
pFillsyl.Color = GetRGB(200, 50, 50);
object oFillsyl = pFillsyl;
IPolygon pPlolygon = pFeat.Shape as IPolygon;//使用FilashShape来使要素闪烁
axMapControl1.FlashShape(pPlolygon, 2, 1, pFillsyl);
axMapControl1.DrawShape(pPlolygon, ref oFillsyl);
}
}
}
private IColor GetRGB(int p1, int p2, int p3)
{
IRgbColor pColor = new RgbColorClass();
pColor.Red = p1;
pColor.Green = p2;
pColor.Blue = p3;
return pColor;
}
ARCEngine中查询对象
猜你喜欢
转载自blog.csdn.net/qq_40323256/article/details/84971296
今日推荐
周排行