-
添加图例、比例尺、指北针
代码中有注释,直接上
指北针
C#
代码
?
public
void
AddNorthArrow(IPageLayout pageLayout)
?
{
?
IGraphicsContainer container = pageLayout
as
IGraphicsContainer;
?
IActiveView activeView = pageLayout
as
IActiveView;
?
//
获得
MapFrame
?
IFrameElement frameElement =
ame(ap);
?
IMapFrame mapFrame = frameElement
as
IMapFrame;
?
//
根据
MapSurround
的
uid
,创建相应的
M
apSurroundFrame
和
MapSurround<
/p>
?
UID uid =
new
UIDClass();
??
=
;
??
IMapSurroundFrame mapSurroundFrame =
SurroundFrame(uid,
null
);
??
p>
//
设置
MapSurroundFram
e
中指北针的点符号
??
IMapSurround mapSurround = round;
??
IMarkerNorthArrow markerNorthArrow = mapSurround
as
IMarkerNorthArrow;
??
IMarkerSymbol markerSymbol = Symbol;
??
=
18;
??
Symbol = markerSymbol;
??
//QI
,确定
mapSurroun
dFrame
的位置
??
IElement element = mapSurroundFrame
as
IElement;
??
IEnvelope envelope =
new
EnvelopeClass();
??
rds(0.2, 0.2, 5, 5);
??
ry
= envelope;
??
//
使用<
/p>
IGraphicsContainer
接口添加显示
??
ment(element, 0);
??
h();
??
}
比例尺
C#
代码
??
public
void
AddScalebar(IPageLayout
pageLayout)