-
AE
二次开发,通过代码向
axPageLayout
控件,插入图例和指北
针的
方法
2013-10-30 11:40
1083
人阅读
评论
(0)
收藏
举报
分类:
ArcGIS Engine
(
25<
/p>
)
版权声明:本文为博主原创文章,未经博主允许不得转载。
1.
插入图例的方法如下:
[html]
view plain
copy
1.
///
2.
///
给页面布局控件添加图例
3.
///
4.
///
name
=
>
5.
public static void
InsertLegend(AxPageLayoutControl axPageLayout)
6.
{
7.
8.
IElement
pElement
=
< br>axPageLayout
.FindElementByName(
9.
if
(pElement != null)
10.
{
11.
Element(pElement);
//
删除已经存在的图例
12.
}
13.
IPageLayout
pPageLayout
=
axPageLayout
.PageLayout;
14.
IGraphicsContainer
pGraphicsContainer
=
pPageLayout
as
IGraphicsContaine
r;
15.
IActiveView
pActiveView
=
pPageLayout
as IActiveView;
16.
UID
pID
=
new
UIDClass();
17.
=
;
18.
19.
IMapFrame
pMapFrame
=
pGraphicsContainer
.FindFrame(ap)
p>
as IMapFrame;
20.
if
(
pMapFrame
== null) return;
21.
IMapSurroundFrame
pMapSurroundFrame
=
< br>pMapFrame
.CreateSurroundFrame(pID,
p>
null);
22.
if
(
pMapSurroundFrame
== null)
return;
23.
//
设置图例范围
24.
IEnvelope
pEnv
=
new
EnvelopeClass();
25.
rds(2, 2, 6, 6);