没有合适的资源?快使用搜索试试~ 我知道了~
axMapControl绘制临时点
需积分: 12 319 浏览量
2018-07-20
21:56:05
上传
评论
收藏 2KB TXT 举报
ArcEngine二次开发中,在axMapControl中绘制一个临时点,并指定大小、位置和赋指定颜色
资源推荐
资源详情
资源评论



















private void Draw_Point()
{
try
{
//首先要实现容器接口
IGraphicsContainer pGraphicsContainer = axMapControl1.ActiveView as IGraphicsContainer;
pGraphicsContainer.DeleteAllElements();//清空容器里面所有的元素
//设置点的坐标
IPoint pPoint = new PointClass();
pPoint.SpatialReference = axMapControl1.Map.SpatialReference;
double X=(double)PointData_X[curPtIndex];
double Y=(double)PointData_Y[curPtIndex];
pPoint.PutCoords(X,Y);
//IMarkerElement用来获得symbol属性
IMarkerElement pMarkerElement = new MarkerElementClass();
//用ISimpleMarkerSymbol来设置点的属性
ISimpleMarkerSymbol pSymbol = new SimpleMarkerSymbolClass();
IRgbColor pRGBcolor = new RgbColorClass();
pRGBcolor.Red = 255;
pRGBcolor.Green = 0;
pRGBcolor.Blue = 0;
pSymbol.Color = pRGBcolor;//红色
pMarkerElement.Symbol = pSymbol;
//IElement用来获得Geometry属性
IElement pElement = pMarkerElement as IElement;
{
try
{
//首先要实现容器接口
IGraphicsContainer pGraphicsContainer = axMapControl1.ActiveView as IGraphicsContainer;
pGraphicsContainer.DeleteAllElements();//清空容器里面所有的元素
//设置点的坐标
IPoint pPoint = new PointClass();
pPoint.SpatialReference = axMapControl1.Map.SpatialReference;
double X=(double)PointData_X[curPtIndex];
double Y=(double)PointData_Y[curPtIndex];
pPoint.PutCoords(X,Y);
//IMarkerElement用来获得symbol属性
IMarkerElement pMarkerElement = new MarkerElementClass();
//用ISimpleMarkerSymbol来设置点的属性
ISimpleMarkerSymbol pSymbol = new SimpleMarkerSymbolClass();
IRgbColor pRGBcolor = new RgbColorClass();
pRGBcolor.Red = 255;
pRGBcolor.Green = 0;
pRGBcolor.Blue = 0;
pSymbol.Color = pRGBcolor;//红色
pMarkerElement.Symbol = pSymbol;
//IElement用来获得Geometry属性
IElement pElement = pMarkerElement as IElement;
资源评论

qq_31185415
- 粉丝: 0
- 资源: 1

上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制
