云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > ArcEngine主要功能源码

ArcEngine主要功能源码

  • 62 次阅读
  • 3 次下载
  • 2025/5/6 7:45:33

double dYmin = pActiveView.Extent.YMin - ((pEnvelope.YMin - pActiveView.Extent.YMin)*pActiveView.Extent.Height/

pEnvelope.Height); double dXmax = dXmin + dWidth; double dYmax = dYmin + dHeight;

pEnvelope.PutCoords(dXmin, dYmin, dXmax, dYmax);

}

pActiveView.Extent = pEnvelope; pActiveView.Refresh(); break;

#endregion

#region 漫游

case \:

mainMapControl.Pan(); break;

#endregion

#region 选择要素

case \: IEnvelope pEnv = mainMapControl.TrackRectangle();

IGeometry pGeo = pEnv as IGeometry;

//矩形框若为空,即为点选时,对点范围进行扩展 if (pEnv.IsEmpty == true) {

tagRECT r;

r.left = e.x - 5; r.top = e.y - 5; r.right = e.x + 5; r.bottom = e.y + 5;

pActiveView.ScreenDisplay.DisplayTransformation.TransformRect(pEnv,

ref r, 4);

pEnv.SpatialReference = pActiveView.FocusMap.SpatialReference; }

pGeo = pEnv as IGeometry;

mainMapControl.Map.SelectByShape(pGeo, null, false);

mainMapControl.Refresh(esriViewDrawPhase.esriViewGeoSelection, null, null);

break;

#endregion

#region 区域导出

case \: //删除视图中数据

mainMapControl.ActiveView.GraphicsContainer.DeleteAllElements(); mainMapControl.ActiveView.Refresh(); IPolygon pPolygon = DrawPolygon(mainMapControl);

if (pPolygon == null) return; ExportMap.AddElement(pPolygon, mainMapControl.ActiveView);

if (frmExpMap == null || frmExpMap.IsDisposed) {

frmExpMap = new FormExportMap(mainMapControl); }

frmExpMap.IsRegion = true;

frmExpMap.GetGeometry = pPolygon as IGeometry; frmExpMap.Show();

frmExpMap.Activate(); break; #endregion

#region 距离量算

case \:

//判断追踪线对象是否为空,若是则实例化并设置当前鼠标点为起始点

if (pNewLineFeedback == null) {

//实例化追踪线对象 pNewLineFeedback = new NewLineFeedbackClass();

pNewLineFeedback.Display = (mainMapControl.Map as IActiveView).ScreenDisplay;

//设置起点,开始动态线绘制

pNewLineFeedback.Start(pPointPt); dToltalLength = 0; }

else //如果追踪线对象不为空,则添加当前鼠标点 {

pNewLineFeedback.AddPoint(pPointPt); }

//pGeometry = m_PointPt; if (dSegmentLength != 0) {

dToltalLength = dToltalLength + dSegmentLength;

}

break; #endregion

#region 面积量算 case \:

if (pNewPolygonFeedback == null) {

//实例化追踪面对象

pNewPolygonFeedback = new NewPolygonFeedback();

pNewPolygonFeedback.Display = (mainMapControl.Map as IActiveView).ScreenDisplay; ;

pAreaPointCol.RemovePoints(0, pAreaPointCol.PointCount);

//开始绘制多边形

pNewPolygonFeedback.Start(pPointPt); pAreaPointCol.AddPoint(pPointPt, ref missing, ref missing); } else {

pNewPolygonFeedback.AddPoint(pPointPt); pAreaPointCol.AddPoint(pPointPt, ref missing, ref missing); }

break; #endregion

#region 要素选择

case \:

IPoint point = new PointClass();

IGeometry pGeometry = point as IGeometry; mainMapControl.Map.SelectByShape(pGeometry, null, false);

mainMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, null, null);

break; #endregion

default: break; } }

else if (e.button == 2) {

pMouseOperate = \;

mainMapControl.MousePointer = esriControlsMousePointer.esriPointerDefault; } }

private void mainMapControl_OnMouseMove(object sender, IMapControlEvents2_OnMouseMoveEvent e)

搜索更多关于: ArcEngine主要功能源码 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

double dYmin = pActiveView.Extent.YMin - ((pEnvelope.YMin - pActiveView.Extent.YMin)*pActiveView.Extent.Height/ pEnvelope.Height); double dXmax = dXmin + dWidth; double dYmax = dYmin + dHeight;

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com