阅读:1901回复:4
Mapcontrol和PageLayout
利用ArcEngine开发,如何实现Mapcontrol中的图能直接显示在PageLayout控件中,就是类似ArcMap的数据视图和Layout视图的切换功能
|
|
1楼#
发布于:2004-11-26 08:42
看看他的例子吧,pagelayerout的例子就是啦
|
|
|
2楼#
发布于:2004-11-29 09:24
<P>类似于视图切换,主要是实现将MapControl上的地图通过Layout打印输出</P><P>在视图切换过程中,MapControl中总是出现花屏,是否是我没有将视图切换好</P><P>使用下列代码生成Map</P><P> Dim pMapFrame As IMapFrame
Dim pActiveView As IActiveView Set pMapFrame = New MapFrame Set pMapFrame.Map = pMap pMapFrame.MapScale = pMap.MapScale pMapFrame.ExtentType = esriExtentScale 'Set the position of the new map frame Dim pElement As IElement Dim pEnv As IEnvelope Set pElement = pMapFrame Set pEnv = New Envelope pEnv.PutCoords 0, 0, 20, 20 pElement.Geometry = pEnv Set pActiveView = LayoutMain.ActiveView pElement.Activate pActiveView.ScreenDisplay 'Add mapframe to the layout Dim pGraphicsContainer As IGraphicsContainer Set pGraphicsContainer = LayoutMain.GraphicsContainer pGraphicsContainer.AddElement pMapFrame, 0 'Make the newly added map the focus map Set pActiveView.FocusMap = pMap 'Refresh ActiveView and TOC pActiveView.Refresh LayoutMain.ZoomToWholePage LayoutMain.Refresh esriViewNone</P><P>使用下列代码设置Layout视图</P><P> Dim pActiveView As IActiveView Set pActiveView = MapMain.ActiveView pActiveView.Deactivate MapMain.Visible = False LayoutMain.Visible = True Set pActiveView = LayoutMain.ActiveView pActiveView.Activate Me.hWnd </P><P>返回回Map视图</P><P>Private Sub SetMapView() Dim pActiveView As IActiveView Set pActiveView = LayoutMain.ActiveView pActiveView.Deactivate LayoutMain.Visible = False</P><P> MapMain.Visible = True Set pActiveView = MapMain.ActiveView pActiveView.Activate Me.hWnd pActiveView.Refresh End Sub</P> |
|
3楼#
发布于:2004-11-30 10:39
<P>急啊!没有人回答</P>
|
|