[DllImport("User32.dll")]
public static extern int GetDesktopWindow();
private IMapDocument mapDocument = null;
private void ChangeMapScale()
{
mapDocument.Open(@"C:\Temp\foo.mxd", null);
IPageLayout pageLayout = mapDocument.PageLayout;
IActiveView activeView = (IActiveView)pageLayout;
IMap map = activeView.FocusMap;
activeView = (IActiveView)mapDocument.PageLayout;
activeView.Activate(GetDesktopWindow()); // 注意,呼叫了這個函式,才使得設定 MapScale 生效
map.MapScale = value;
activeView.Refresh();
mapDocument.Save(true, true);
}
按這個方法解決后會出現全屏情況 怎么將這個全屏去除呢,大佬們 麻煩幫我解決下,謝謝!
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/32836.html
標籤:C#
