首页 > 其他分享 >ArcGIS Pro代码修改布局方向

ArcGIS Pro代码修改布局方向

时间:2023-03-02 23:13:01浏览次数:46  
标签:layout orientation Width Pro page ArcGIS var Height 代码

private void SwitchPageOrientation() {

 if (LayoutView.Active == null)
   return;
 var layout = LayoutView.Active.Layout;
     
 QueuedTask.Run(() => {
   var page = layout.GetPage();
   //what is the orientation?
   var orientation = page.Height > page.Width ? PageOrientation.Portrait :
           PageOrientation.Landscape;
   //TODO - use orientation as needed

   //switch portrait->landscape or vice versa
   var wd = page.Width;
   var ht = page.Height;

   page.Height = wd;
   page.Width = ht;

   //Available at 3.1
   layout.SetPage(page, true);//resize the page elements
   //Available at 3.0 and 2.x
   //layout.SetPage(page);<-- use this flavor for no element resizing
   //layout.SetPage(page, false);<-- or set the resize flag false
 });
}

 

标签:layout,orientation,Width,Pro,page,ArcGIS,var,Height,代码
From: https://www.cnblogs.com/gisoracle/p/17173953.html

相关文章