ArcGIS Engine 10 开发手册(7-12)ArcGIS Engine中点状图的调用
发布时间: 2018-01-07
所属分类: ArcGIS Engine 10 开发手册
本文介绍使用ArcGIS Engine生成点状图的方法。
ArcGIS Engine生成点状图示例代码
代码如下:
public class DotRender
{
IGeoFeatureLayer pGeoLayer;
IDotDensityRenderer pDotDensityRenderer; //渲染对象
IDotDensityFillSymbol pDotDensityFill; //渲染填充符号对象,大对象分解小对象, 独立的可看作对象。
IRendererFields pRendFields; //用那个字段渲染。理解层次关系。
ISymbolArray pSymbolArry;
public DotRender (AxMapControl pMapControl, IFeatureLayer pFtLayer, double pValue, string pFieldName)
{
IActiveView pActiveView;
this.pGeoLayer = pFtLayer as IGeoFeatureLayer;
pActiveView = pMapControl.ActiveView;
pDotDensityRenderer = new DotDensityRendererClass ();
pRendFields = pDotDensityRenderer as IRendererFields;
pRendFields.AddField (pFieldName, pFieldName); //同一个对象的接口的切换,很方便的。
this.pDotDensityFill = new DotDensityFillSymbolClass ();
pDotDensityFill.DotSize = 2.46;
pDotDensityFill.Color = GetRGBColor (0, 100, 0);
pDotDensityFill.BackgroundColor = GetRGBColor (255, 255, 255);
pSymbolArry = pDotDensityFill as ISymbolArray; //难道是密度。
ISimpleMarkerSymbol pSimpleMark;
pSimpleMark = new SimpleMarkerSymbolClass ();
pSimpleMark.Style = esriSimpleMarkerStyle.esriSMSDiamond;
pSimpleMark.Size = 2.46;
pSimpleMark.Color = GetRGBColor (235, 190, 89);
pSymbolArry.AddSymbol (pSimpleMark as ISymbol);
pDotDensityRenderer.DotDensitySymbol = pDotDensityFill;
pDotDensityRenderer.DotValue = pValue;
pDotDensityRenderer.CreateLegend ();
pGeoLayer.Renderer = (IFeatureRenderer) pDotDensityRenderer;
pActiveView.PartialRefresh (esriViewDrawPhase.esriViewGeography, null, null);
}
public IRgbColor GetRGBColor (int r, int g, int b)
{
IRgbColor pRGB;
pRGB = new RgbColorClass ();
pRGB.Red = r;
pRGB.Green = g;
pRGB.Blue = b;
return pRGB;
}
}
效果如图
ArcGIS Engine 10 开发手册全集
ArcGIS Engine 10 开发手册全集: ArcGIS Engine 10 开发手册
相关阅读
声明
1.本文所分享的所有需要用户下载使用的内容(包括但不限于软件、数据、图片)来自于网络或者麻辣GIS粉丝自行分享,版权归该下载资源的合法拥有者所有,如有侵权请第一时间联系本站删除。
2.下载内容仅限个人学习使用,请切勿用作商用等其他用途,否则后果自负。
手机阅读
公众号关注
知识星球
手机阅读
最新GIS干货
私享圈子