| 5 | 1/1 | 返回列表 |
| 查看: 1422 | 回復: 8 | ||
| 本帖產生 1 個 EPI ,點擊這里進行查看 | ||
| 當前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||
xiangling1金蟲 (正式寫手)
|
[求助]
AE+c#讓某一圖元居中,閃爍
|
|
下面的代碼,為何不能實現(xiàn)閃爍,請高手指點哈?![]() //初始化圖形容器對象 IGraphicsContainer pContainer = axMapControl1.Map as IGraphicsContainer; //刪除要素 pContainer.DeleteAllElements(); //點樣式 ISimpleMarkerSymbol pSimpleMarkerSymbol = new SimpleMarkerSymbolClass(); pSimpleMarkerSymbol.Color = GetRGBColor(255,0,0);//取色 pSimpleMarkerSymbol.Size = 3; IMarkerElement pMarkerElement = new MarkerElementClass(); pMarkerElement.Symbol = pSimpleMarkerSymbol; IElement pElement = pMarkerElement as IElement; pElement.Geometry = pFeature.Shape; int nIndex = 0; pContainer.AddElement(pMarkerElement as IElement, nIndex); //居中顯示 axMapControl1.CenterAt((IPoint)pFeature.Shape); Application.DoEvents(); axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, pContainer, axMapControl1.ActiveView.Extent); axMapControl1.FlashShape(pFeature.Shape, 4, 300, pSimpleMarkerSymbol); [ Last edited by xiangling1 on 2011-6-27 at 13:19 ] |


至尊木蟲 (小有名氣)

金蟲 (正式寫手)
|
金蟲 (小有名氣)
英超煮帥
|
//初始化圖形容器對象 IGraphicsContainer pContainer = axMapControl1.Map as IGraphicsContainer; //刪除要素 pContainer.DeleteAllElements(); //點樣式 ISimpleMarkerSymbol pSimpleMarkerSymbol = new SimpleMarkerSymbolClass(); pSimpleMarkerSymbol.Color = GetRGBColor(255, 0, 0);//取色 pSimpleMarkerSymbol.Size = 10; IMarkerElement pMarkerElement = new MarkerElementClass(); pMarkerElement.Symbol = pSimpleMarkerSymbol; IElement pElement = pMarkerElement as IElement; pElement.Geometry = pFeature.Shape; int nIndex = 0; pContainer.AddElement(pMarkerElement as IElement, nIndex); //居中顯示 //IEnvelope env = pFeature.Shape.Envelope; //IPoint pt = new PointClass(); //pt.X = (env.XMin + env.XMax) / 2; //pt.Y = (env.YMin + env.YMax) / 2; //IPoint pt = pFeature.Shape as IPoint; //IEnvelope env = new EnvelopeClass(); //env.PutCoords(pt.X - 1000,pt.Y - 1000,pt.X +1000,pt.Y +1000); axMapControl1.CenterAt((IPoint)pFeature.Shape); Application.DoEvents(); axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, pContainer, axMapControl1.ActiveView.Extent); axMapControl1.FlashShape(pFeature.Shape, 4, 300, pSimpleMarkerSymbol); 我采用相同的代碼,在我這邊可以實現(xiàn)高亮顯示,其中樓主有一個自定義的方法,GetColor(),可能是這個方法的問題,下面是我重寫的這個方法: public IColor GetRGBColor(int red, int green, int blue) { IRgbColor pColor = new RgbColorClass(); pColor.Red = red; pColor.Green = green; pColor.Blue = blue; return pColor as IColor; } 如果程序中報出什么錯誤,請樓主提供出來,以便分析原因。 |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 調劑求院校招收 +5 | 鶴鯨鴿 2026-03-28 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 2026年華南師范大學歡迎化學,化工,生物,生醫(yī)工等專業(yè)優(yōu)秀學子加入! +3 | llss0711 2026-03-28 | 5/250 |
|
|
[考研] 11408軟件工程求調劑 +3 | Qiu學ing 2026-03-28 | 3/150 |
|
|
[考研] 求調劑 +3 | QiMing7 2026-03-25 | 4/200 |
|
|
[考研] 311求調劑 +9 | lin0039 2026-03-26 | 9/450 |
|
|
[考研] 277跪求調劑 +5 | 1915668 2026-03-27 | 9/450 |
|
|
[考研] 265求調劑11408 +3 | 劉小鹿lu 2026-03-27 | 3/150 |
|
|
[考研] 324求調劑 +8 | hanamiko 2026-03-26 | 10/500 |
|
|
[考研] 325求調劑 +5 | 李嘉圖·S·路 2026-03-23 | 5/250 |
|
|
[考研] 336材料求調劑 +7 | 陳瀅瑩 2026-03-26 | 9/450 |
|
|
[考研] 求調劑 一志愿 本科 北科大 化學 343 +6 | 13831862839 2026-03-24 | 7/350 |
|
|
[考研] 281求調劑 +3 | 亞克西good 2026-03-26 | 5/250 |
|
|
[考研] 材料考研求調劑 +3 | Dendel 2026-03-23 | 6/300 |
|
|
[考研] 352求調劑 +4 | 大米飯! 2026-03-22 | 4/200 |
|
|
[考研] 化學調劑一志愿上海交通大學336分-本科上海211 +4 | 小魚愛有機 2026-03-25 | 4/200 |
|
|
[考研] 309求調劑 +4 | gajsj 2026-03-25 | 5/250 |
|
|
[考研] 生物技術與工程 +3 | 1294608413 2026-03-25 | 4/200 |
|
|
[考研] 347求調劑 +4 | L when 2026-03-25 | 4/200 |
|
|
[考研] 336化工調劑 +4 | 王大坦1 2026-03-23 | 5/250 |
|
|
[考研] 070300,一志愿北航320求調劑 +3 | Jerry0216 2026-03-22 | 5/250 |
|