ericleo
路人甲
路人甲
  • 注册日期2005-08-18
  • 发帖数5
  • QQ
  • 铜币121枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1148回复:1

[求助]LineElement颜色改变问题

楼主#
更多 发布于:2005-11-10 11:36
<P>我在AxMapControl1中画了一个LineElement,然后想要改变其颜色及宽度<BR>使用下列程序码,但是LineElement不会有任何反应,也没有出现错误信息<BR>希望各位前辈可以帮忙一下,谢谢!!</P>
<P>        Dim pGContSelect As ESRI.ArcGIS.Carto.IGraphicsContainerSelect<BR>        Dim pElement As ESRI.ArcGIS.Carto.IElement<BR>        Dim pLineElement As ESRI.ArcGIS.Carto.ILineElement</P>
<P>        pGContSelect = AxMapControl1.ActiveView.GraphicsContainer<BR>        pElement = pGContSelect.SelectedElement(0)</P>
<P>        pLineElement = pElement</P>
<P>        Dim pRGB As ESRI.ArcGIS.Display.IRgbColor<BR>        pRGB = New ESRI.ArcGIS.Display.RgbColor<BR>        pRGB.Red = 200<BR>        pRGB.Blue = 0<BR>        pRGB.Green = 0</P>
<P><BR>        pLineElement.Symbol.Color = pRGB<BR>        pLineElement.Symbol.Width = 20.0<BR>        AxMapControl1.ActiveView.GraphicsContainer.UpdateElement(pLineElement)<BR>        AxMapControl1.ActiveView.Refresh()<BR></P>
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2005-11-11 17:35
<P>定义个iLineElement,再定义个线符号ISimpleLineSymbol </P>
<P>pLineElem.Symbol = LineSymbol</P>
<P>设置LineSymbol的颜色就可以了</P>
<P>    Set pFcolor = New RgbColor<BR>    pFcolor.RGB = RGB(0, 255, 0)</P>
<P>    Set LineSym = New SimpleLineSymbol<BR>    LineSym.Color = pFcolor<BR>    LineSym.Width = 2</P>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
游客

返回顶部