追风浪子
路人甲
路人甲
  • 注册日期2004-06-08
  • 发帖数166
  • QQ
  • 铜币782枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1562回复:3

IPageLayoutControl 接口

楼主#
更多 发布于:2004-09-10 14:43
<P>在vb.net中IPageLayoutControl .AddElement(pElement,Geometry,Symbology,Name,ZOrder)后面三个参数可以省略,但在C#中必须写。。。。。。我想把MapControl 中的Map传给PageLayoutControl中间把MapFrame做为个pElement加入,在vb.net中已经可以,但在C#中后面的参数出错,请教高手指点。。。。。。。。。</P><img src="images/post/smile/dvbbs/em12.gif" /><img src="images/post/smile/dvbbs/em12.gif" /><img src="images/post/smile/dvbbs/em12.gif" /><img src="images/post/smile/dvbbs/em12.gif" /><img src="images/post/smile/dvbbs/em12.gif" />
喜欢0 评分0
destnity
路人甲
路人甲
  • 注册日期2004-03-25
  • 发帖数341
  • QQ
  • 铜币272枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2004-09-10 15:01
<P>private void axPageLayoutControl1_OnMouseDown(object sender, ESRI.ArcGIS.PageLayoutControl.IPageLayoutControlEvents_OnMouseDownEvent e)
{
    IRgbColor rgbColor = new RgbColorClass();
    rgbColor.Red = 255;
    axPageLayoutControl1.AddElement(new RectangleElement(), axPageLayoutControl1.TrackRectangle(), rgbColor,null,-1);     axPageLayoutControl1.CtlRefresh(esriViewDrawPhase.esriViewGraphics,null,null);
}
[Visual Basic 6.0]
The following code example adds a new element that implements IEnvelope and is colored Red.</P><P>Private Sub PageLayoutControl1_OnMouseDown (ByVal _
button As Long, ByVal shift As Long, ByVal x As Long, ByVal _
y As Long, ByVal pageX As Double, ByVal pageY As Double)
  
  Dim pRgbColor As IRgbColor
  Set pRgbColor = New RgbColor
  pRgbColor.Red = 255
  PageLayoutControl1.AddElement New RectangleElement, _
  PageLayoutControl1.TrackRectangle,pRgbColor
  PageLayoutControl1.Refresh esriViewGraphics</P><P>End Sub
[Visual Basic .NET]
The following code example adds a new element that implements IEnvelope and is colored Red.</P><P>Private Sub AxPageLayoutControl1_OnMouseDown(ByVal sender As System.Object, ByVal e As ESRI.ArcGIS.PageLayoutControl.IPageLayoutControlEvents_OnMouseDownEvent) Handles AxPageLayoutControl1.OnMouseDown
  Dim pRgbColor As IRgbColor
  pRgbColor = New RgbColor
  pRgbColor.Red = 255
  AxPageLayoutControl1.AddElement(New RectangleElement, AxPageLayoutControl1.TrackRectangle, pRgbColor)
  AxPageLayoutControl1.CtlRefresh(esriViewDrawPhase.esriViewGraphics)
End Sub
这是在线帮助中的。</P>
签 名: 不能超过 250 个字符 文字将出现在您发表的文章的结尾处。
举报 回复(0) 喜欢(0)     评分
追风浪子
路人甲
路人甲
  • 注册日期2004-06-08
  • 发帖数166
  • QQ
  • 铜币782枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2004-09-11 21:50
<P>我这样试过。还是不行</P><P>IMapFrame ipMapFrame = new MapFrameClass();
ipMapFrame.Map = ipMapControl.Map;                      
IElement ipElement = ipMapFrame as IElement;
IEnvelope ipEnv = null;
ipEnv = axPageLayoutControl.Extent;
IRgbColor ipRgbColor = new RgbColorClass(); </P>
<P>ipRgbColor.Red = 255;
string strName = "FF";
<FONT color=#ee11c2>其中这几种都不行:</FONT>
 (a)、axPageLayoutControl.AddElement(ipElement,ipEnv as object,ipRgbColor as object,strName as object,1);
(b)、axPageLayoutControl.AddElement(ipElement,ipEnv,ipRgbColor ,strName ,1);
(c)、axPageLayoutControl.AddElement(ipElement,ipEnv,ipRgbColor,null,1);</P>
举报 回复(0) 喜欢(0)     评分
irobot
路人甲
路人甲
  • 注册日期2004-09-21
  • 发帖数6
  • QQ
  • 铜币138枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2004-10-27 21:43
<P>axPageLayoutControl.AddElement不行的地方可以试试得到IGraphicContainer对象,然后用 IGraphicContainer.AddElement(pElement,0)只要两个参数,很好用,我的指北针,比例尺都是用它加的</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部