添加公里网格(修改)
来源:互联网 发布:阿里云服务器网速很慢 编辑:程序博客网 时间:2024/04/28 20:39
private void 添加公里网格ToolStripMenuItem_Click(object sender, EventArgs e) { IMap pMap; IActiveView pPageActView = this.axPageLayoutControl1.PageLayout as IActiveView; pMap = pPageActView.FocusMap; IMapGrid pMapGrid; IMeasuredGrid pMeaGrid = new MeasuredGridClass(); pMapGrid = pMeaGrid as IMapGrid; pMeaGrid.FixedOrigin = true; pMeaGrid.Units = pMap.MapUnits; //间隔 pMeaGrid.XIntervalSize = 1000; pMeaGrid.YIntervalSize = 1000; //绘制范围 注意不要设为0,不然添加公里网之后会很卡 pMeaGrid.XOrigin = 40000000; pMeaGrid.YOrigin = 40000000; //属性 IProjectedGrid pProGird; pProGird = pMeaGrid as IProjectedGrid; pProGird.SpatialReference = pMap.SpatialReference; pMapGrid.Name = "公里网"; //边框 ICalibratedMapGridBorder pGridBorder = new CalibratedMapGridBorderClass(); pGridBorder.BackgroundColor = GetColor(255, 255, 255); pGridBorder.BorderWidth = 2; pGridBorder.ForegroundColor = GetColor(0, 0, 0); pGridBorder.Interval = 50; pGridBorder.Alternating = true; pMapGrid.Border = pGridBorder as IMapGridBorder; //公里网字体 ICornerGridLabel pCornerLabel = new CornerGridLabelClass(); stdole.StdFont pFont = new stdole.StdFontClass(); pFont.Name = "Arial"; pFont.Size = 12; pCornerLabel.set_CornerLabel(esriGridCornerEnum.esriGridCornerLowerLeft, true); //公里网样式 IPrincipalDigitsGridLabel pPrincipalDiaitsLabel = pCornerLabel as IPrincipalDigitsGridLabel; pPrincipalDiaitsLabel.PrincipalDigitCount = 2; pPrincipalDiaitsLabel.BaseDigitCount = 5; pPrincipalDiaitsLabel.UnitSuffix = "m."; pPrincipalDiaitsLabel.EastingSuffix = "E"; pPrincipalDiaitsLabel.NorthingSuffix = "N"; //显示的Label样式 IGridLabel pLabel = pPrincipalDiaitsLabel as IGridLabel; pLabel.Font = pFont as stdole.IFontDisp; pLabel.Color = GetColor(0, 0, 0); pLabel.LabelOffset = 2; pMapGrid.LabelFormat = pLabel; //图形容器 IGraphicsContainer pGraphicsContainer; pGraphicsContainer = pPageActView as IGraphicsContainer; IMapFrame pMapFrame; pMapFrame = pGraphicsContainer.FindFrame(pMap) as IMapFrame; //添加公里网 IMapGrids pMapGrids = pMapFrame as IMapGrids; pMapGrids.AddMapGrid(pMapGrid); //刷新 pPageActView.PartialRefresh(esriViewDrawPhase.esriViewBackground, null, null); }
最终的效果<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">图:<img src="http://img.blog.csdn.net/20140923170907984?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveGlhb3l1YW5mZW5f/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /></span>
0 0
- 添加公里网格(修改)
- ArcEngine IPageLayout 添加经纬网和公里网
- unity修改网格数据
- threejs添加网格辅助线grid
- RecyclerView封装——添加Header、Footer(在网格瀑布流布局中独占一行)
- RecyclerView封装——添加Header、Footer(在网格瀑布流布局中独占一行)
- 给Flex图表控件添加网格背景
- Maya: 菜单 编辑网格 >添加分段
- crm2013处理子网格添加按钮
- [ArcEngine地图制图系列]—添加网格
- OpenLayers 3 之 添加地图网格
- 在图像上添加网格【matlab】
- 添加,修改
- Unity3D修改模型的网格数据
- Unity3D修改模型的网格数据
- Unity3D修改模型的网格数据
- 百公里
- 25公里
- 关于mysql函数GROUP_CONCAT
- hdu 2077 汉诺塔IV (递推)
- 20步打造最安全的Nginx Web服务器
- java 垃圾回收机制
- C++学习笔记(第五章 二维数组及应用 之二)
- 添加公里网格(修改)
- 1002. A+B for Polynomials (25)——PAT (Advanced Level) Practise
- 网络爬虫(七):亮剑!爬虫框架小抓抓Scrapy闪亮登场!
- Android 音乐播放器Service+MediaPlayer
- Mina、Netty、Twisted一起学(八):HTTP服务器
- 详解CUDA核函数及运行时参数<<<>>>
- GPU高性能计算之CUDA-第一章
- Linux+libusb开发用户USB无驱通讯
- Linux下Nagios的安装与配置