ArcGIS Engine - 添加内图廓线

3种方式(围绕所选元素、围绕所有元素和在页边距之内)
在这里插入图片描述
添加内图廓线的三种方式:

		private void updateProperty()
        {
            //添加整理图廓线
            IEnvelope pEnvelope = new EnvelopeClass();
            FrameElement pFrameElement = new FrameElementClass();
            IFrameElement pIFrameElement = pFrameElement as IFrameElement;
            pIFrameElement.Border = new SymbolBorder();
            
            if (radioOut.Checked)
            {
                pEnvelope = pageLayoutControl.Page.PrintableBounds;
            }
            if(radioAll.Checked)
            {
                IGroupElement pGroupElement = new GroupElementClass();
                IGraphicsContainer pGraphicsContainer = pageLayoutControl.PageLayout as IGraphicsContainer;
                pGraphicsContainer.Reset();
                IElement pElement = pGraphicsContainer.Next();
                while (pElement != null)
                {
                    pGroupElement.AddElement(pElement);
                    pElement = pGraphicsContainer.Next();
                }
                if (pGroupElement.ElementCount != 0)
                {
                    //获取包含所有选择要素的最小矩形框
                    IElement pTagGroupElement = pGroupElement as IElement;
                    pTagGroupElement.QueryBounds(pageLayoutControl.ActiveView.ScreenDisplay as IDisplay, pEnvelope);

                }
            }
            if(radioIn.Checked)
            {
                IGroupElement pGroupElement = new GroupElementClass();
                IGraphicsContainer pGraphicsContainer = pageLayoutControl.PageLayout as IGraphicsContainer;
                IGraphicsContainerSelect pGraphicsContainerSelect = pageLayoutControl.PageLayout as IGraphicsContainerSelect;
                IEnumElement pEnumElement = pGraphicsContainerSelect.SelectedElements;
                pEnumElement.Reset();
                IElement pElement = pEnumElement.Next();

                while (pElement != null)
                {
                    pGroupElement.AddElement(pElement);
                    pElement = pEnumElement.Next();
                }
                if (pGroupElement.ElementCount != 0)
                {
                    //获取包含所有选择要素的最小矩形框
                    IElement pTagGroupElement = pGroupElement as IElement;
                    pTagGroupElement.QueryBounds(pageLayoutControl.ActiveView.ScreenDisplay as IDisplay, pEnvelope);
                }
            }

            try
            {
                pFrameElement.Geometry = pEnvelope;
                //添加图廓线
                pageLayoutControl.ActiveView.GraphicsContainer.AddElement(pFrameElement, 0);
                pageLayoutControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("设置图廓线失败!" + ex.Message);
            }
            
        }
  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
打印的修饰,是一项非常烦人,繁琐的工作,本人推出如下工具 1、 批量生成标准分幅或行政区划,地打印所需的(或框)整饰内容:公里网,十字丝,经纬网以及标注,四角的经纬度标注,四周的文字表示和自动填写结合表的内容。一方面标准规范,另一方大大地提高了你的工作效率,使你在打印地中,从重复、繁杂的工作中摆脱出来。 2、 系统缺省按照地形标准设置,也提供各种参数定制:如地比例尺, 地左下角,下面的比例尺信息,右下角,左边的单位信息,右上角(机密等),上边的标题,内容,位置,字体的大小,颜色都可以自己定义,提供公里网,十字丝,经纬网三种方式供你选择,你可以设置公里网,十字丝,经纬网的间距,文字标注的大小位置。 3、 输入一幅号,就可以生成对应整饰内容。提供标准幅号(可以是新幅也可以是旧幅号,支持地比例尺有1:100万、1:50万、1:25万、1:10万、1:5万、1:2.5万、1:1万和1:5000比例尺))生成单幅的打印梯形,内外严格平行,都是梯形,文字标注按照梯形的斜线标注;根据标准幅文件批量生成标准梯形;根据行政区划文件的形对象,批量生成矩形,你可以定义地与内的距离,可以采用经纬网标注整饰,比例尺也可以灵活自定义。 4、 标注智能化程度高,要求左对齐,一定左对齐,中间对齐自动中间对齐,右对齐自动右对齐,位置严格按照定义位置标注,字体大小,颜色样式一定定义生成,并且可以和字段、或则日期配套使用。 本软件是绿色软件,无需安装,操作方便,自动记忆上次界面设置,下次打开就自动调出上次设置,包括文字的内容,字体的大小,颜色,你的选择(如本次选经纬网,下次打开默认设置还是经纬网),让你真正一劳永逸。 本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/gisoracle/archive/2009/08/25/4481531.aspx

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

王八八。

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值