xiaolinzi
路人甲
路人甲
  • 注册日期2004-03-29
  • 发帖数35
  • QQ
  • 铜币149枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1924回复:3

[求助]ArcEngine 元素转换为要素

楼主#
更多 发布于:2007-12-18 11:22
ArcEngine 元素转换为要素?用到什么接口啊,谢谢                                                                
[此贴子已经被作者于2007-12-18 13:59:57编辑过]
喜欢0 评分0
xiaolinzi
路人甲
路人甲
  • 注册日期2004-03-29
  • 发帖数35
  • QQ
  • 铜币149枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2007-12-18 14:31
<DIV right" align=right></DIV>IPictureElement如何保存详见代码<BR><BR>
<DIV>Dim   pMxDoc   As   IMxDocument   <BR>          Set   pMxDoc   =   ThisDocument   <BR>            <BR>          Dim   pPictureElement   As   IPictureElement   <BR>          '   why   doesn't   the   following   line   work   ...   <BR>          'Set   pPictureElement   =   new   esriCore.JpgPictureelement   <BR>            <BR>          '   while   this   one   does   ?   <BR>          Set   pPictureElement   =   CreateObject("esriCore.JpgPictureelement")   <BR>          pPictureElement.ImportPictureFromFile   "D:\arcgis\sampledata\untitled.jpg"   <BR>            <BR>          Dim   pEnv   As   IEnvelope   <BR>          Set   pEnv   =   New   Envelope   <BR>          pEnv.PutCoords   1,   1,   5,   5   <BR>            <BR>          Dim   pElement   As   IElement   <BR>          Set   pElement   =   pPictureElement   <BR>          pElement.Geometry   =   pEnv   <BR>            <BR>          Dim   pGC   As   IGraphicsContainer   <BR>          Set   pGC   =   pMxDoc.PageLayout   <BR>            <BR>          pGC.AddElement   pElement,   0   <BR>          Dim   pAV   As   IActiveView   <BR>          Set   pAV   =   pGC   <BR>          pAV.PartialRefresh   esriViewGraphics,   pElement,   pEnv</DIV>
举报 回复(0) 喜欢(0)     评分
cool7432047
路人甲
路人甲
  • 注册日期2007-09-21
  • 发帖数1
  • QQ
  • 铜币108枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2007-12-18 18:36
<P>对啊  我正好也碰到这个问题!!!!!</P>
<P>AE9.2+C# 开发交流群:9034740   进来大家一起交流下</P>
举报 回复(0) 喜欢(0)     评分
xiaolinzi
路人甲
路人甲
  • 注册日期2004-03-29
  • 发帖数35
  • QQ
  • 铜币149枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2007-12-20 11:02
<DIV class=t_msgfont>解决方法:</DIV>
<DIV class=t_msgfont> </DIV>
<DIV class=t_msgfont><FONT color=#0000ff>IElementCollection pElementCol = new ElementCollectionClass();<BR>                    pElementCol.Add(element, 0);<BR>                    IWorkspaceEdit pWorkspaceEdit = (IWorkspaceEdit)((IDataset)pFeatureLayer).Workspace;<BR>                    pWorkspaceEdit.StartEditOperation();<BR>                    IFeature pFeature = pFeatureLayer.FeatureClass.CreateFeature();<BR>                    IAnnotationFeature pAnnoFeature = (IAnnotationFeature)pFeature;<BR>                    pAnnoFeature.Annotation = element;<BR>                    pFeature.Store();<BR>                    pWorkspaceEdit.StopEditOperation();</FONT></DIV>
<DIV class=t_msgfont><FONT color=#0000ff></FONT></DIV>
<DIV class=t_msgfont><FONT color=#ff0000>
<DIV>保存MXD文档,可以保存Element或者转换成Feature存在Featurelayer中</DIV>
<DIV class=t_msgfont>为什么老是报<FONT color=#0000ff>pAnnoFeature值为空啊 </FONT></DIV></FONT></DIV><!-- BlogbotContentEnd -->
举报 回复(0) 喜欢(0)     评分
游客

返回顶部