Exemple #1
0
        private void Print_Load(object sender, EventArgs e)
        {
            //Mxd文件是否存在
            //******??????会打印两页
            if (axPageLayoutControl1.CheckMxFile(m_FileName))
            {
                //加载Mxd到PageLayout
                axPageLayoutControl1.LoadMxFile(m_FileName, "");

                IActiveView            activeView             = axPageLayoutControl1.ActiveView.FocusMap as IActiveView;
                IDisplayTransformation displayeTransformation = activeView.ScreenDisplay.DisplayTransformation;
                displayeTransformation.VisibleBounds = GIS.Common.DataEditCommon.g_pAxMapControl.Extent;
                displayeTransformation.Rotation      = axMap.Rotation;
                double angle  = Math.Round(displayeTransformation.Rotation, 0);
                ILayer player = GIS.Common.DataEditCommon.GetLayerByName(activeView.FocusMap, LayerNames.LAYER_ALIAS_MR_HCGZMWSYCLD);
                MyMapHelp.Angle_Symbol(player, -angle);
                player = GIS.Common.DataEditCommon.GetLayerByName(activeView.FocusMap, LayerNames.LAYER_ALIAS_MR_WSHLD);
                MyMapHelp.Angle_Symbol(player, -angle);
                player = GIS.Common.DataEditCommon.GetLayerByName(activeView.FocusMap, LayerNames.LAYER_ALIAS_MR_WSYLD);
                MyMapHelp.Angle_Symbol(player, -angle);
                //displayeTransformation.ReferenceScale = axMap.ReferenceScale;
                activeView.Refresh();

                m_graphicContainer = axPageLayoutControl1.PageLayout as IGraphicsContainer;
            }


            //MapCopy();

            InitToolBar();

            InitializePrintPreviewDialog();    //初始化打印预览对话框
            m_printDialog = new PrintDialog(); //打印对话框实例化
            InitializePageSetupDialog();       //初始化打印设置对话框
        }
Exemple #2
0
 void m_axmap_OnViewRefreshed(object sender, IMapControlEvents2_OnViewRefreshedEvent e)
 {
     if (Math.Round(m_axmap.Rotation, 0) != angle)
     {
         angle         = Math.Round(m_axmap.Rotation, 0);
         txtRoate.Text = angle.ToString();
         ILayer player = GIS.Common.DataEditCommon.GetLayerByName(m_axmap.Map, LayerNames.LAYER_ALIAS_MR_HCGZMWSYCLD);
         MyMapHelp.Angle_Symbol(player, -angle);
         player = GIS.Common.DataEditCommon.GetLayerByName(m_axmap.Map, LayerNames.LAYER_ALIAS_MR_WSHLD);
         MyMapHelp.Angle_Symbol(player, -angle);
         player = GIS.Common.DataEditCommon.GetLayerByName(m_axmap.Map, LayerNames.LAYER_ALIAS_MR_WSYLD);
         MyMapHelp.Angle_Symbol(player, -angle);
     }
 }