默认头像
路人甲
路人甲
  • 注册日期2011-05-08
  • 发帖数1
  • QQ
  • 铜币106枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2418回复:0

哪位高手替我看一下下面的代码,是关于实现闪烁选择的实体的代码

楼主#
更多 发布于:2011-05-13 15:21

哪位高手替我看一下下面的代码,是关于实现闪烁选择的实体的代码,当我的程序运行时,就是实现不了闪烁,不知道是怎么会事。希望赐教啊!

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);

       }
   }
 

}

喜欢0 评分0
默认头像

返回顶部