| 9 | 1/1 | 返回列表 |
| 查看: 1421 | 回復(fù): 8 | |||
| 本帖產(chǎn)生 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; } 如果程序中報出什么錯誤,請樓主提供出來,以便分析原因。 |

金蟲 (正式寫手)

金蟲 (正式寫手)

金蟲 (小有名氣)
英超煮帥

木蟲 (著名寫手)
| 9 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 調(diào)劑求院校招收 +5 | 鶴鯨鴿 2026-03-28 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 275求調(diào)劑 +10 | Micky11223 2026-03-25 | 14/700 |
|
|
[考研] 化學(xué)0703 調(diào)劑 306分 一志愿211 +4 | 26要上岸 2026-03-28 | 4/200 |
|
|
[考研] 材料與化工272求調(diào)劑 +9 | 阿斯蒂芬2004 2026-03-28 | 9/450 |
|
|
[考研] 299求調(diào)劑 +7 | 嗯嗯嗯嗯2 2026-03-27 | 7/350 |
|
|
[考研] 070300求調(diào)劑306分 +4 | 26要上岸 2026-03-27 | 4/200 |
|
|
[考研] 291求調(diào)劑 +15 | hhhhxn.. 2026-03-23 | 21/1050 |
|
|
[考研] 277跪求調(diào)劑 +5 | 1915668 2026-03-27 | 9/450 |
|
|
[考研] 286求調(diào)劑 +4 | 丟掉懶惰 2026-03-27 | 7/350 |
|
|
[考研] 一志愿南師大0703化學(xué) 275求調(diào)劑 +4 | Ripcord上岸 2026-03-27 | 4/200 |
|
|
[考研]
|
18419759900 2026-03-25 | 8/400 |
|
|
[考研] 化學(xué)308分求調(diào)劑 +8 | 你好明天你好 2026-03-23 | 9/450 |
|
|
[考研] 327求調(diào)劑 +7 | prayer13 2026-03-23 | 7/350 |
|
|
[考研] 求調(diào)劑 +8 | Auroracx 2026-03-22 | 8/400 |
|
|
[考研] 297求調(diào)劑 +6 | 田洪有 2026-03-26 | 6/300 |
|
|
[考研] B區(qū)考研調(diào)劑 +4 | yqdszhdap- 2026-03-22 | 5/250 |
|
|
[考研] 300分,材料,求調(diào)劑,英一數(shù)二 +5 | 超贊的 2026-03-24 | 5/250 |
|
|
[考研] 一志愿國科過程所081700,274求調(diào)劑 +3 | 三水研0水立方 2026-03-23 | 3/150 |
|
|
[考研] 284求調(diào)劑 +3 | yanzhixue111 2026-03-23 | 6/300 |
|
|
[考研] 接收2026碩士調(diào)劑(學(xué)碩+專碩) +4 | allen-yin 2026-03-23 | 6/300 |
|