/// <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. Python实现对文件夹内文本文件递归查找

    平台:Win7 64 bit,IDLE Python 3.4.0 经常有这样的需求:在一个文本文件里查找特定字符串,这很好实现,用任何文本查看工具几乎都可以做到.而有的时候,想查找一个文件夹下的所有文 ...

  2. Bullet的学习资源(用Doxygen生成API文档)

    Bullet 全称 Bullet Physics Library,是著名的开源物理引擎(可用于碰撞检测.刚体模拟.可变形体模拟),这里将bullet的学习资源整理一下,希望能帮助入门者少走弯路. 看下 ...

  3. EL与Velocity基本语法总结:

    El(expression language): 基本语法点: $与{}搭配使用是常态取值 . 与[]的区别,后者可以取特殊值:- .等 支持一些基本的逻辑运算: && || > ...

  4. LintCode Merge Sorted Array

    两个排好序的数组, A有m个数, 长度够长, B有n个数, 长度为n, 将B放到A里, 不用buffer数组(临时数组), 就用A将两个合在一起, 同时排好序. 方法: 从右边将两个数组里最大的数取出 ...

  5. Javascript中的数组方法总结

    1.concat():将两个或多个数组合并成一个数组 arrayObject.concat(arrayX,arrayX,......,arrayX),返回一个新的数据,arrayX可以是数值也可以是数 ...

  6. JavaScript 立即执行函数

    js中(function(){…})()立即执行函数写法理解 javascript和其他编程语言相比比较随意,所以javascript代码中充满各种奇葩的写法,有时雾里看花,当然,能理解各型各色的写法 ...

  7. CSS布局奇技淫巧:各种居中

    居中是我们使用css来布局时常遇到的情况.使用css来进行居中时,有时一个属性就能搞定,有时则需要一定的技巧才能兼容到所有浏览器,本文就居中的一些常用方法做个简单的介绍. 注:本文所讲方法除了特别说明 ...

  8. Extended TCP/IP Stack In Linux: Netfilter Hooks and IP Table

    https://www.amazon.com/gp/product/1118887735 The chapter about debugging is rather outdated - it des ...

  9. Servlet访问第一次500,刷新后404的解决办法

    第一次运行错误:HTTP Status 500 -  --------------------------------------------type Exception reportmessage  ...

  10. centos安装mongodb 3.2.9

    centos 6.5 x64 1.下载地址:用迅雷下载,直接下载下不动 https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.2 ...