阅读:1818回复:3
请问AE怎么实现保存SceneControl的工作区
<TABLE height="85%" width="95%" align=center border=0>
<TR> <TD vAlign=top width=* height="100%"><IMG src="http://www.gisempire.com/bbs/Skins/Default/topicface/face1.gif" align=absMiddle border=0> <B>请问AE怎么实现保存SceneControl的工作区</B><BR> <P>就是我在SceneControl控件里放大等操作,我可以随时保存当前的工作区,然后重新打开文件,地图显示和我关闭前状态是一样的?</P></TD></TR></TABLE> |
|
|
1楼#
发布于:2006-06-23 13:48
<P><FONT color=#0000ff>private</FONT> IMapDocument m_MapDocument;<BR></P>
<P> <CODE><FONT color=#0000ff>private void</FONT></CODE> OpenDocument(<CODE><FONT color=#0000ff>string</FONT></CODE> sFilePath)<BR> {<BR> <CODE><FONT color=#008000>//Create a new map document</FONT></CODE><BR> m_MapDocument = <CODE><FONT color=#0000ff>new</FONT></CODE> MapDocumentClass();<BR> <CODE><FONT color=#008000>//Open the map document selected</FONT></CODE><BR> m_MapDocument.Open(sFilePath,"");<BR> <CODE><FONT color=#008000>//Set the PageLayoutControl page layout to the map document page layout</FONT></CODE><BR> axPageLayoutControl1.PageLayout = m_MapDocument.PageLayout;<BR> txtMapDocument.Text = m_MapDocument.DocumentFilename;<BR> }<BR><BR> <CODE><FONT color=#0000ff>private void</FONT></CODE> SaveDocument()<BR> {<BR> <CODE><FONT color=#008000>//Check that the document is not read only</FONT></CODE><BR> <CODE><FONT color=#0000ff>if</FONT></CODE> (m_MapDocument.get_IsReadOnly(m_MapDocument.DocumentFilename) == <CODE><FONT color=#0000ff>true</FONT></CODE>)<BR> {<BR> MessageBox.Show("This map document is read only!");<BR> return;<BR> }<BR> <CODE><FONT color=#008000>//Save with the current relative path setting</FONT></CODE><BR> m_MapDocument.Save(m_MapDocument.UsesRelativePaths,<CODE><FONT color=#0000ff>true</FONT></CODE>);<BR> MessageBox.Show("Changes saved successfully!");<BR> }<BR><BR>Files for this sample: <your install location>/samples/Controls/SaveMapDocumentCSharp.zip </P> |
|
|
2楼#
发布于:2006-06-23 13:57
<P>谢谢:axPageLayoutControl1.PageLayout = m_MapDocument.PageLayout;</P>
<P>但是这是针对PageLayoutControl对象的吧,我需要保存SceneControl对象的工作区,请问怎么实现?<BR></P> |
|
|
3楼#
发布于:2006-09-22 10:29
<P>我也想知道</P>
|
|