📄 formsimrend.cs
字号:
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.Carto;
using ESRI.ArcGIS.Display;
namespace WindowsApplication1
{
public partial class formsimrend : Form
{
public IMap pMap;
public formsimrend()
{
InitializeComponent();
}
public void renderer()
{
IGeoFeatureLayer pGeoFeatureL;
ISimpleRenderer pSimpleRenderer;
IFillSymbol pSimpleFills;
ILineSymbol pLineSymbol;
pSimpleFills = new SimpleFillSymbolClass();
pGeoFeatureL = (IGeoFeatureLayer)pMap.get_Layer(0);
IRgbColor pRgbColor = new RgbColorClass();
pRgbColor = new RgbColorClass();
if (colorDialog1.ShowDialog() == DialogResult.OK)
{
pRgbColor.Red = colorDialog1.Color.R;
pRgbColor.Green = colorDialog1.Color.G;
pRgbColor.Blue = colorDialog1.Color.B;
pSimpleFills.Color = GetRGB(colorDialog1.Color.R, colorDialog1.Color.G, colorDialog1.Color.B);
}
else return;
pLineSymbol = new SimpleLineSymbolClass();
pLineSymbol.Color = GetRGB(0, 0, 0);
pLineSymbol.Width = 1;
pSimpleFills.Outline = pLineSymbol;
pSimpleRenderer = new SimpleRendererClass();
pSimpleRenderer.Symbol = (ISymbol)pSimpleFills;
pGeoFeatureL.Renderer = (IFeatureRenderer)pSimpleRenderer;
}
private IRgbColor GetRGB(int R, int G, int B)
{
IRgbColor pRGB;
pRGB = new RgbColorClass();
pRGB.Red = R;
pRGB.Green = G;
pRGB.Blue = B;
return pRGB;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -