阅读:1148回复:1
[求助]LineElement颜色改变问题
<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> |
|
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> |
|
|