/// <summary> 
/// 根据查询条件构造
/// </summary> 
/// <param name="where">查询条件</param> 
public void FilterLayer(string where) 

IFeatureLayer flyr = (IFeatureLayer)axMapControl1.get_Layer(0); 
IFeatureClass fcls = flyr.FeatureClass;

IQueryFilter queryFilter = new QueryFilterClass(); 
queryFilter.WhereClause = where;

// 缩放到选择结果集,并高亮显示 
ZoomToSelectedFeature(flyr, queryFilter);

//闪烁选中得图斑 
IFeatureCursor featureCursor = fcls.Search(queryFilter, true); 
FlashPolygons(featureCursor); 
}

/// <summary> 
/// 缩放到选择结果集,并高亮显示 
/// </summary> 
/// <param name="pFeatureLyr"></param> 
/// <param name="pQueryFilter"></param> 
private void ZoomToSelectedFeature(IFeatureLayer pFeatureLyr, IQueryFilter pQueryFilter) 

#region 高亮显示查询到的要素集合

//符号边线颜色 
IRgbColor pLineColor = new RgbColor(); 
pLineColor.Red = 255; 
ILineSymbol ilSymbl = new SimpleLineSymbolClass(); 
ilSymbl.Color = pLineColor; 
ilSymbl.Width = 5;

//定义选中要素的符号为红色 
ISimpleFillSymbol ipSimpleFillSymbol = new SimpleFillSymbol(); 
ipSimpleFillSymbol.Outline = ilSymbl; 
RgbColor pFillColor = new RgbColor(); 
pFillColor.Green = 60; 
ipSimpleFillSymbol.Color = pFillColor; 
ipSimpleFillSymbol.Style = esriSimpleFillStyle.esriSFSForwardDiagonal;

//选取要素集 
IFeatureSelection pFtSelection = pFeatureLyr as IFeatureSelection; 
pFtSelection.SetSelectionSymbol = true; 
pFtSelection.SelectionSymbol = (ISymbol)ipSimpleFillSymbol; 
pFtSelection.SelectFeatures(pQueryFilter, esriSelectionResultEnum.esriSelectionResultNew, false);

#endregion

ISelectionSet pSelectionSet = pFtSelection.SelectionSet; 
//居中显示选中要素 
IEnumGeometry pEnumGeom = new EnumFeatureGeometry(); 
IEnumGeometryBind pEnumGeomBind = pEnumGeom as IEnumGeometryBind; 
pEnumGeomBind.BindGeometrySource(null, pSelectionSet); 
IGeometryFactory pGeomFactory = new GeometryEnvironmentClass(); 
IGeometry pGeom = pGeomFactory.CreateGeometryFromEnumerator(pEnumGeom);

axMapControl1.ActiveView.Extent = pGeom.Envelope; 
axMapControl1.ActiveView.Refresh(); 
}

/// <summary> 
/// 闪烁选中得图斑 
/// </summary> 
/// <param name="featureCursor"></param> 
private void FlashPolygons(IFeatureCursor featureCursor) 

IArray geoArray = new ArrayClass(); 
IFeature feature = null; 
while ((feature = featureCursor.NextFeature()) != null) 

//feature是循环外指针,所以必须用ShapeCopy 
geoArray.Add(feature.ShapeCopy); 
}

//通过IHookActions闪烁要素集合 
HookHelperClass m_pHookHelper = new HookHelperClass(); 
m_pHookHelper.Hook = axMapControl1.Object; 
IHookActions hookActions = (IHookActions)m_pHookHelper;

hookActions.DoActionOnMultiple(geoArray, esriHookActions.esriHookActionsPan); 
//hookActions.DoActionOnMultiple(geoArray, esriHookActions.esriHookActionsGraphic); 
//hookActions.DoActionOnMultiple(geoArray, esriHookActions.esriHookActionsZoom); 
Application.DoEvents(); 
m_pHookHelper.ActiveView.ScreenDisplay.UpdateWindow();

hookActions.DoActionOnMultiple(geoArray, esriHookActions.esriHookActionsFlash); 

}

from: http://www.cnblogs.com/feilong3540717/archive/2011/07/27/2118651.html

同时闪烁多个要素代码(ArcEngine)的更多相关文章

  1. ARM汇编程序闪烁灯与其反汇编代码比较

    /* *LED闪烁 *led.s */ #define GPJ0CON 0xE0200240 #define GPJ0DAT 0xE0200244 .global _start //把 _start ...

  2. ArcGIS 要素闪烁

    ArcGIS 要素闪烁 通过双击要素图例,闪烁定位到要素,并且闪烁一段时间: IFeatureLayer featureLayer = layer as IFeatureLayer;          ...

  3. arcengine 开发经典帖

    http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=25575&page=1&extra= 使用ArcGIS Engine 开发自定义 ...

  4. arcengine 开发经典帖 【强烈推荐仔细研读】

    转自原文 arcengine 开发经典帖 使用ArcGIS Engine 开发自定义GIS应用: 第一部分:使用ArcGIS Engine 发布自定义GIS应用软件-全面了解ArcGIS Engine ...

  5. NodeMCU入门(2):在线构建、刷入固件,上传代码

    准备工作 1.NodeMCU模块 2.ESP8266Flasher.exe 3.ESPlorer v0.2.0-rc6 构建固件 Building the firmware提供了三种构建你自己固件的方 ...

  6. arcgis 要素服务增删改查

    两种方式: 第一种 要素服务的增删改操作,在ArcGIS API for JS中给我们提供了三个类用于要素的增Add,删Delete,改Update 添加draw和要素服务 //用于操作的要素图层,注 ...

  7. 关于印发利用DEM确定耕地坡度分级技术规定(试行)的通知

    下载:http://files.cnblogs.com/files/gisoracle/%E5%88%A9%E7%94%A8DEM%E7%A1%AE%E5%AE%9A%E8%80%95%E5%9C%B ...

  8. JavaScript侧边悬浮框

    <script> window.onscroll=function(){ var oDiv=document.getElementById('div1'); var scrollTop=d ...

  9. css兼容问题集合

    css兼容问题 兼容问题 1.文字本身的大小不兼容.同样是font-size:14px的宋体文字,在不同浏览器下占的空间是不一样的,ie下实际占高16px,下留白3px,ff下实际占高17px,上留白 ...

随机推荐

  1. pylot是一款开源的web性能测试工具

    pylot是一款开源的web性能测试工具,http://www.pylot.org/ 参考文档:http://www.pylot.org/gettingstarted.html很容易上手 使用分为以下 ...

  2. data process for large scale datasets

    Kmeans:   总体而言,速度(单线程): yael_kmeans > litekmeans ~ vl_kmeans 1.vl_kemans (win10 + matlab 15 + vs1 ...

  3. 两个list取不同值

    转自同名博文,未知真正出处,望作者见谅 如题:有List<String> list1和List<String> list2,两个集合各有上万个元素,怎样取出两个集合中不同的元素 ...

  4. Date Range Picker时间插件非常不错,主要体现在选择一个时间区间

    地址:http://www.daterangepicker.com/ demo地址:http://tamble.github.io/jquery-ui-daterangepicker/#event a ...

  5. HTML5上传图片到ASP.NET.MVC

    @{ ViewBag.Title = "Home Page";} <!DOCTYPE HTML PUBLIC><html><head> < ...

  6. dedecms 后台发布后的文章不能编辑出现一片空白的解决办法

    dede后台无法写新文章也无法编辑以前的文档,文章编辑的地方无法写入,出现无法显示该页面的问题,这是怎么回事?我的dede在ftp中换过文件夹,是不是跟这个有关?该如何解决这个问题? 以下修改是针对d ...

  7. bootstrap-16

    进度条----基本样式: Bootstrap框架中对于进度条提供了一个基本的样式,一个100%宽度的背景色,然后高亮颜色表示完成进度.其实制作这样的进度条非常容易,一般是使用两个容器,外容器具有一定的 ...

  8. 关于C语言的问卷调查(补交)

    你对自己的未来有什么规划?做了哪些准备?(还是处于比较迷茫的状态:我做的准备是吧自己对计算机的兴趣提起来!) 你认为什么是学习?学习有什么用?现在学习动力如何?为什么?(学习就是学自己不会的东西:增加 ...

  9. php部分---PDO;

    PDO数据访问抽象层 PDO的三个功能: 1.操作其它数据库2.事务功能3.防止SQL注入攻击 操作数据库: 造PDO对象 //$dsn = "mysql:dbname=mydb;host= ...

  10. Quant的笑话

    Q) Why was the FX quant so unlucky with the ladies?A) Because he always kept his dates short. Q) Why ...