arcgis 这段代码是在mapcontrol上绘制一个点。
问题是:这段代码单独执行的话没什么。但是如果放在线程中就不显示。求高手指点publicvoidshow(doublex,doubley,refAxMapControlax...
问题是:这段代码单独执行的话没什么。但是如果放在线程中就不显示。求高手指点
public void show(double x, double y, ref AxMapControl axMapControl1)
{
IPoint pPoint = new PointClass();
IMap pMap = axMapControl1.Map;
IActiveView pActiveView = pMap as IActiveView;
IGraphicsContainer pGraphicsContainer;
IElement pElement = new MarkerElementClass();
pGraphicsContainer = (IGraphicsContainer)pActiveView;
IMarkerElement pMarkerElement;
pMarkerElement = new MarkerElementClass();
pPoint.X = x;
pPoint.Y = y;
pElement = pMarkerElement as IElement;
pElement.Geometry = pPoint;
pGraphicsContainer.AddElement((IElement)pMarkerElement, 1);
pActiveView.Refresh();
axMapControl1.Refresh();
} 展开
public void show(double x, double y, ref AxMapControl axMapControl1)
{
IPoint pPoint = new PointClass();
IMap pMap = axMapControl1.Map;
IActiveView pActiveView = pMap as IActiveView;
IGraphicsContainer pGraphicsContainer;
IElement pElement = new MarkerElementClass();
pGraphicsContainer = (IGraphicsContainer)pActiveView;
IMarkerElement pMarkerElement;
pMarkerElement = new MarkerElementClass();
pPoint.X = x;
pPoint.Y = y;
pElement = pMarkerElement as IElement;
pElement.Geometry = pPoint;
pGraphicsContainer.AddElement((IElement)pMarkerElement, 1);
pActiveView.Refresh();
axMapControl1.Refresh();
} 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询