ArcGIS Engine 10 开发手册(7-9)ArcGIS Engine中比例图接口及调用实例
发布时间: 2018-01-04
所属分类: ArcGIS Engine 10 开发手册
和比例渲染图相关的接口
IProportionalSymbolRenderer 该接口被 ProportionalSymbolRenderer 对象实现,用来控制唯一值渲染的主 要信息,如字段设置,最小值和最大值等。
示例:比例渲染代码:
代码如下:
public class ProPortialRender
{
public ProPortialRender (AxMapControl pMapcontrol, IFeatureLayer pFtLayer, string pFieldName)
{
IGeoFeatureLayer pGeo = pFtLayer as IGeoFeatureLayer;
IProportionalSymbolRenderer pProRender = new ProportionalSymbolRendererClass ();
pProRender.Field = pFieldName;
pProRender.ValueUnit = esriUnits.esriUnknownUnits;
ISimpleMarkerSymbol pMarkerSymbol = new SimpleMarkerSymbolClass ();
pMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
pMarkerSymbol.Size = 2;
pMarkerSymbol.Color = GetRGBColor (255, 0, 0);
pProRender.MinSymbol = pMarkerSymbol as ISymbol;
IDataStatistics pDataStat = new DataStatisticsClass ();
IFeatureCursor pFtCursor = pFtLayer.FeatureClass.Search (null, false);
pDataStat.Cursor = pFtCursor as ICursor;
pDataStat.Field = pFieldName;
pProRender.MinDataValue = pDataStat.Statistics.Minimum;
pProRender.MaxDataValue = pDataStat.Statistics.Maximum;
IFillSymbol pFillS = new SimpleFillSymbolClass ();
pFillS.Color = GetRGBColor (239, 228, 190);
ILineSymbol pLineS = new SimpleLineSymbolClass ();
pLineS.Width = 2;
pFillS.Outline = pLineS;
ISimpleFillSymbol pSFillS = pFillS as ISimpleFillSymbol;
pSFillS.Color = GetRGBColor (100, 100, 253);
pProRender.BackgroundSymbol = pFillS;
pGeo.Renderer = pProRender as IFeatureRenderer;
pMapcontrol.ActiveView.Refresh ();
}
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干货
私享圈子