public void AddLegend() { #region//直接调用AE的生成图例Form; /////////////////////////////////////////////////////////////////////// ////Create a legend wizard and grab hold of the ILegendWizard interface /* ILegendWizard m_legendWizard = new LegendWizardClass(); * //Set the legend wizard pageLayout property * m_legendWizard.PageLayout = m_pagelayoutControl.PageLayout; * // Give the LegendWizard a legendframe - must do this * m_legendWizard.InitialLegendFrame = mapSurroundFrame; * * //显示legendWizard * m_Ok = m_legendWizard.DoModal(m_pagelayoutControl.hWnd); * if (m_Ok == true) * { * IEnvelope envelope = new EnvelopeClass(); * //Envelope for the legend * envelope.PutCoords(10, 10,30, 30); * //Set the geometry of the MapSurroundFrame * IElement element = (IElement)mapSurroundFrame; * element.Geometry = envelope; * //Add the legend to the PageLayout * m_pagelayoutControl.AddElement(element, Type.Missing, Type.Missing, "Legend", 0); * } */ //////////////////////////////////////////////////// #endregion ExportMapProj.frmLegendWizard frmLegend = new ExportMapProj.frmLegendWizard(m_mapControl, m_pagelayoutControl); frmLegend.ShowDialog(); m_pagelayoutControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); }
public void AddLegend() { #region//ֱ�ӵ���AE������ͼ��Form; /////////////////////////////////////////////////////////////////////// ////Create a legend wizard and grab hold of the ILegendWizard interface /* ILegendWizard m_legendWizard = new LegendWizardClass(); //Set the legend wizard pageLayout property m_legendWizard.PageLayout = m_pagelayoutControl.PageLayout; // Give the LegendWizard a legendframe - must do this m_legendWizard.InitialLegendFrame = mapSurroundFrame; //��ʾlegendWizard m_Ok = m_legendWizard.DoModal(m_pagelayoutControl.hWnd); if (m_Ok == true) { IEnvelope envelope = new EnvelopeClass(); //Envelope for the legend envelope.PutCoords(10, 10,30, 30); //Set the geometry of the MapSurroundFrame IElement element = (IElement)mapSurroundFrame; element.Geometry = envelope; //Add the legend to the PageLayout m_pagelayoutControl.AddElement(element, Type.Missing, Type.Missing, "Legend", 0); } */ //////////////////////////////////////////////////// #endregion ExportMapProj.frmLegendWizard frmLegend = new ExportMapProj.frmLegendWizard( m_mapControl ,m_pagelayoutControl ); frmLegend.ShowDialog (); m_pagelayoutControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); }