-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathProPortialRender.cs
118 lines (60 loc) · 2.44 KB
/
ProPortialRender.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.GlobeCore;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.DataSourcesGDB;
namespace EngineApplication
{
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;
}
}
}