哪位高手替我看一下下面的代码,是关于实现闪烁选择的实体的代码,当我的程序运行时,就是实现不了闪烁,不知道是怎么会事。希望赐教啊!
private void searchFeature(string sqlfiter, IFeatureLayer pFeatureLayer)
{
IFeatureLayer pFeatLyr;
pFeatLyr = pFeatureLayer;
IQueryFilter pFilter;
pFilter = new QueryFilterClass();
IIdentifyObj pIdObj;
IArray pIDArray;
IFeatureIdentifyObj pFeatIdObj;
//设置查询条件
pFilter.WhereClause = sqlfiter;
IFeatureCursor pFeatCursor;
pFeatCursor = pFeatLyr.Search(pFilter, true);
IFeature pFeat;
IGraphicsContainer pGraphicsContainer;
IActiveView pAV;
pGraphicsContainer = axMapControl1.Map as IGraphicsContainer;
pIDArray = pIdentify.Identify(pEnv);
pFeat = pFeatCursor.NextFeature();
while (pFeat == null)
{
pFeat = pFeatCursor.NextFeature();
if (pFeat != null)
{
ISimpleFillSymbol pFillsyl;
pFillsyl = new SimpleFillSymbolClass();
pFillsyl.Color = GetRGBColor(220,0, 0);
object oFillsyl;
oFillsyl = pFillsyl;
IPolygon pPolygon;
pPolygon = pFeat.Shape as IPolygon;
//闪烁实体;
pFeatIdObj = (IFeatureIdentifyObj)pIDArray.get_Element(0);
pIdObj = (IIdentifyObj)pFeatIdObj;
pIdObj.Flash(axMapControl1.ActiveView.ScreenDisplay);
axMapControl1.FlashShape(pPolygon, 15, 20, pFillsyl);
axMapControl1.DrawShape(pPolygon, ref oFillsyl);
}
}
}