/// <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. js活动倒计时

    html代码: <div "></div> <div "></div> <div "></div> ...

  2. IL命令

    部分CIL 操作码 操作码                                           作用 add, sub, mul, div, rem                   ...

  3. 关于MySQL数据导出导入

    工具 mysqlmysqldump 应用举例 导出 导出全库备份到本地的目录 mysqldump -u$USER -p$PASSWD -h127.0.0.1 -P3306 --routines --d ...

  4. LintCode Min Stack

    用两个stack, 第一个按顺序放所有值,第二个只放当前最小值. 注意: 1. 最小值有多个则都放到两个stack里, 尤其别忘放第二个: 2. pop时若两个stack的最上面值相等则都pop, 不 ...

  5. 1.4 云计算的SPI服务模型

    云计算是通过共享资源池的方式来提高资源利用率的.在云计算中,根据其资源池中资源的类别,可以把云计算的服务模型分为三种,即所谓的SPI 模型   应用程序 Software as a Service ( ...

  6. Django后台post请求中的csrf token

    使用Requests库操作自己的Django站点,post登陆admin页面返回403,serverlog显示csrf token not set. csrf token是get登陆页面时服务器放在c ...

  7. 在指定的div中搜索内容,并滚动显示到当前搜索到的内容处

    我想要的是页面中有个带滚动条的div对象,里面有很多内容,想要用js搜索到div中的某个字符串内容,然后将div的滚动条滚动到搜索到的内容处显示,自动定位.先是查找页面中的内容,然后将找到的内容创建t ...

  8. Android Context 上下文 你必须知道的一切

    本文转载于:http://blog.csdn.net/lmj623565791/article/details/40481055 转载请标明出处:http://blog.csdn.net/lmj623 ...

  9. UIScrollView在AutoLayout下的滚动问题

    使用Storyboard编写UI,设置支持AutoLayout. 在其中的一个场景上,添加一个UIScrollView,在对应的代码里增加 - (void)viewDidLoad { [super v ...

  10. SQL系统数据库简介(mssqlsystemresource)

    mssqlsystemresource