ArcEngine 高亮/闪烁

无需刷新

private static void FlashPolygon(IMapControlDefault mapControlDefault, IGeometry iGeometry)
{
    ISimpleFillSymbol iFillSymbol;
    ISymbol iSymbol;
    IRgbColor iRgbColor;
    iFillSymbol = new SimpleFillSymbol();
    iFillSymbol.Style = esriSimpleFillStyle.esriSFSSolid;
    iFillSymbol.Outline.Width = 12;
    iRgbColor = new RgbColor();
    iRgbColor.Red = 0;
    iRgbColor.Green = 162;
    iRgbColor.Blue = 232;
    iFillSymbol.Color = iRgbColor;
    iSymbol = (ISymbol)iFillSymbol;
    iSymbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
    mapControlDefault.ActiveView.ScreenDisplay.SetSymbol(iSymbol);
    mapControlDefault.FlashShape(iGeometry, 3, 200, iSymbol);
}


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ArcEngine 二次开发中高亮显示可以通过以下步骤实现: 1. 在 ArcMap 中选择要素,并获取其几何对象。 2. 创建一个新的 IElement 对象,将几何对象赋值给 IElement.Geometry 属性。 3. 创建一个新的 IRgbColor 对象,设置其颜色属性高亮显示的颜色。 4. 创建一个新的 ILineSymbol 或 IFillSymbol 对象,设置其颜色属性为 IRgbColor 对象。 5. 将 ILineSymbol 或 IFillSymbol 对象分配给 IElement.Symbol 属性。 6. 将 IElement 对象添加到 IGraphicsContainer 对象中。 下面是一个示例代码: ```C# //获取选中的要素 IFeatureSelection featureSelection = (IFeatureSelection)layer; ISelectionSet selectionSet = featureSelection.SelectionSet; IEnumIDs enumIDs = selectionSet.IDs; int iD = -1; while ((iD = enumIDs.Next()) != -1) { //获取选中要素的几何对象 IFeature feature = layer.FeatureClass.GetFeature(iD); IGeometry geometry = feature.ShapeCopy; //创建高亮显示的元素对象 IElement element = new PolygonElementClass(); element.Geometry = geometry; //设置高亮显示的颜色 IRgbColor rgbColor = new RgbColorClass(); rgbColor.Red = 255; rgbColor.Green = 0; rgbColor.Blue = 0; //创建高亮显示的符号对象 ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass(); fillSymbol.Color = rgbColor; //将符号对象赋值给元素对象 element.Symbol = (ISymbol)fillSymbol; //将元素对象添加到地图容器中 IGraphicsContainer graphicsContainer = (IGraphicsContainer)axMapControl1.Map; graphicsContainer.AddElement(element, 0); } //刷新地图 axMapControl1.Refresh(esriViewDrawPhase.esriViewGraphics, null, null); ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值