本文整理汇总了C#中RgbColorClass类的典型用法代码示例。如果您正苦于以下问题:C# RgbColorClass类的具体用法?C# RgbColorClass怎么用?C# RgbColorClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RgbColorClass类属于命名空间,在下文中一共展示了RgbColorClass类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: axSceneControl1_OnMouseDown
private void axSceneControl1_OnMouseDown(object sender, ESRI.ArcGIS.Controls.ISceneControlEvents_OnMouseDownEvent e)
{
IPoint pPoint = null;
object objOwner = null;
object objObject = null;
axSceneControl1.SceneGraph.Locate(axSceneControl1.SceneViewer, e.x, e.y, esriScenePickMode.esriScenePickGeography, true, out pPoint, out objOwner, out objObject);
ITextElement pTextElement = new TextElementClass();
pTextElement.Text = "dddddd";
IGraphicsContainer3D pGCon3D = axSceneControl1.Scene.BasicGraphicsLayer as IGraphicsContainer3D;
IElement pElement = new MarkerElementClass();
IMarkerElement pPointElement = pElement as MarkerElementClass;
ILineElement pLineElement = pElement as ILineElement;
ISimpleLineSymbol pLSymbol = new SimpleLineSymbolClass();
ISimpleMarkerSymbol pMSym = new SimpleMarkerSymbolClass();
IColor pFromColor = new RgbColorClass();
IRgbColor pRgbColor = pFromColor as IRgbColor;
pRgbColor.Red = 255;
pRgbColor.Green = 0;
pRgbColor.Blue = 0;
pMSym.Size = 10;
pMSym.Color = pFromColor;
pMSym.Style = esriSimpleMarkerStyle.esriSMSDiamond;
pPointElement.Symbol = pMSym;
pLSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
pElement.Geometry = pPoint;
pGCon3D.AddElement(pElement as IElement );
axSceneControl1.Scene.SceneGraph.RefreshViewers();
IDisplay3D pIDisplay3D = axSceneControl1.Scene.SceneGraph as IDisplay3D ;
pIDisplay3D.FlashLocation(pPoint);
}
示例2: OnClick
protected override void OnClick()
{
// Access a feature layer from ArcMap
IMap map = ArcMap.Document.FocusMap;
IFeatureLayer featureLayer = map.Layer[0] as IFeatureLayer;
IFeatureClass featureclass = featureLayer.FeatureClass;
IRgbColor lineColor = new RgbColorClass();
lineColor.Red = 255;
lineColor.Green = 255;
lineColor.Blue = 0;
ISimpleLineSymbol lineSymbol = new SimpleLineSymbolClass();
lineSymbol.Color = lineColor;
lineSymbol.Width = 3.0;
ISimpleRenderer simpleRenderer = new SimpleRendererClass();
simpleRenderer.Label = "Taper";
simpleRenderer.Symbol = lineSymbol as ISymbol;
IGeoFeatureLayer geoFL = featureLayer as IGeoFeatureLayer;
geoFL.Renderer = simpleRenderer as IFeatureRenderer;
ArcMap.Document.ActivatedView.Refresh();
ArcMap.Document.ActivatedView.PartialRefresh(esriViewDrawPhase.esriViewGeography, geoFL, ArcMap.Document.ActivatedView.Extent);
ArcMap.Document.UpdateContents();
}
示例3: itemaddlable_Click
//添加标注
void itemaddlable_Click(object sender, EventArgs e)
{
// //使用TextElment绘制标注, fieldName为要绘制的属性
//public static void AddLable(AxMapControl axMapControl, ILayer layer, string fieldName)
//{
ILayer layer = Global.mainmap.Map.get_Layer(0);
IRgbColor pColor = new RgbColorClass()
{
Red = 255,
Blue = 0,
Green = 0
};
IFontDisp pFont = new StdFont()
{
Name = "宋体",
Size = 5
} as IFontDisp;
ITextSymbol pTextSymbol = new TextSymbolClass()
{
Color = pColor,
Font = pFont,
Size = 11
};
IGraphicsContainer pGraContainer = Global.mainmap.Map as IGraphicsContainer;
//遍历要标注的要素
IFeatureLayer pFeaLayer = layer as IFeatureLayer;
IFeatureClass pFeaClass = pFeaLayer.FeatureClass;
IFeatureCursor pFeatCur = pFeaClass.Search(null, false);
IFeature pFeature = pFeatCur.NextFeature();
int index = pFeature.Fields.FindField("NAME");//要标注的字段的索引
IEnvelope pEnv = null;
ITextElement pTextElment = null;
IElement pEle = null;
while (pFeature != null)
{
//使用地理对象的中心作为标注的位置
pEnv = pFeature.Extent;
IPoint pPoint = new PointClass();
pPoint.PutCoords(pEnv.XMin + pEnv.Width * 0.5, pEnv.YMin + pEnv.Height * 0.5);
pTextElment = new TextElementClass()
{
Symbol = pTextSymbol,
ScaleText = true,
Text = pFeature.get_Value(index).ToString()
};
pEle = pTextElment as IElement;
pEle.Geometry = pPoint;
//添加标注
pGraContainer.AddElement(pEle, 0);
pFeature = pFeatCur.NextFeature();
}
(Global.mainmap.Map as IActiveView).PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, Global.mainmap.Extent);
}
示例4: GET
public static IRgbColor GET(int red, int green, int blue)
{
IRgbColor RGB = new RgbColorClass();
RGB.Red = red;
RGB.Green = green;
RGB.Blue = blue;
return RGB;
}
示例5: CreateColor
public static IColor CreateColor(int red, int green, int blue)
{
RgbColorClass class2 = new RgbColorClass();
class2.Red = red;
class2.Green = green;
class2.Blue = blue;
return class2;
}
示例6: get_RgbColor
public static IRgbColor get_RgbColor(int red, int green, int blue)
{
IRgbColor theReturn = new RgbColorClass();
theReturn.Red = red;
theReturn.Green = green;
theReturn.Blue = blue;
return theReturn;
}
示例7: ConvertColorToIColor
public IColor ConvertColorToIColor(Color color)
{
IColor pColor = new RgbColorClass();
pColor.RGB = color.B * 65536 + color.G * 256 + color.R;
return pColor;
}
示例8: SetColor
public static void SetColor(int red, int green, int blue)
{
IRgbColor rgbColor = new RgbColorClass();
rgbColor.Red = red;
rgbColor.Green = green;
rgbColor.Blue = blue;
_color = rgbColor as IColor;
}
示例9: GetRGBColor
public static IRgbColor GetRGBColor(int Red, int Green, int Blue, byte Alpha = 255)
{
IRgbColor color = new RgbColorClass();
color.Red = Red;
color.Green = Green;
color.Blue = Blue;
color.Transparency = Alpha;
return color;
}
示例10: GetRGBColor
private IRgbColor GetRGBColor(int yourRed, int yourGreen, int yourBlue)
{
IRgbColor pRGB;
pRGB = new RgbColorClass();
pRGB.Red = yourRed;
pRGB.Green = yourGreen;
pRGB.Blue = yourBlue;
return pRGB;
}
示例11: CreateRGBColor
public static IRgbColor CreateRGBColor(System.Byte myRed, System.Byte myGreen, System.Byte myBlue)
{
IRgbColor rgbColor = new RgbColorClass();
rgbColor.Red = myRed;
rgbColor.Green = myGreen;
rgbColor.Blue = myBlue;
rgbColor.UseWindowsDithering = true;
return rgbColor;
}
示例12: Color2IColor
/// <summary>
/// Covert a .Net Color class to an ArcObject IColor class.
/// </summary>
/// <param name="color"></param>
/// <returns></returns>
public static IColor Color2IColor(Color color)
{
IRgbColor rgbColor = new RgbColorClass();
rgbColor.NullColor = color.IsEmpty;
rgbColor.Red = color.R;
rgbColor.Green = color.G;
rgbColor.Blue = color.B;
return (IColor)rgbColor;
}
示例13: CreateSimpleFillSymbol
private static ISimpleFillSymbol CreateSimpleFillSymbol(int red, int green, int blue)
{
ISimpleFillSymbol sfs = new SimpleFillSymbolClass();
IRgbColor color = new RgbColorClass();
color.Red = red;
color.Green = green;
color.Blue = blue;
sfs.Color = color;
return sfs;
}
示例14: GetColor
public static IColor GetColor(int red, int green, int blue)
{
IRgbColor rgbColor = new RgbColorClass();
rgbColor.Red = red;
rgbColor.Green = green;
rgbColor.Blue = blue;
IColor color = rgbColor as IColor;
color.Transparency = (byte)_transparency;
return color;
}
示例15: UsingRasterStretchColorRampRender
/// <summary>
/// 拉伸渲染raster图层
/// </summary>
/// <params name="pRLayer">raster图层</params>
/// <remarks></remarks>
public void UsingRasterStretchColorRampRender(IRasterLayer pRLayer)
{
//获得图层
IRaster pRaster = default(IRaster);
pRaster = pRLayer.Raster;
//创建渲染并转换到栅格渲染
IRasterStretchColorRampRenderer pStretchRen = default(IRasterStretchColorRampRenderer);
pStretchRen = new RasterStretchColorRampRenderer();
IRasterRenderer pRasRen = default(IRasterRenderer);
pRasRen = (IRasterRenderer)pStretchRen;
//栅格渲染赋值和更新
pRasRen.Raster = pRaster;
pRasRen.Update();
//定义起止颜色
IRgbColor pFromColor = new RgbColorClass();
pFromColor.Red = 0;
pFromColor.Green = 255;
pFromColor.Blue = 0;
IRgbColor pToColor = new RgbColorClass();
pToColor.Red = 255;
pToColor.Green = 0;
pToColor.Blue = 0;
//创建颜色条
IAlgorithmicColorRamp pRamp = new AlgorithmicColorRamp();
pRamp.Size = 255;
pRamp.FromColor = pFromColor;
pRamp.ToColor = pToColor;
bool bOK;
pRamp.CreateRamp(out bOK);
//插入颜色条和选择渲染波段
pStretchRen.BandIndex = 0;
pStretchRen.ColorRamp = pRamp;
//用新的设置更新渲染并赋值给图层
pRasRen.Update();
pRLayer.Renderer = (IRasterRenderer)pStretchRen;
//释放内存
pRLayer = null;
pRaster = null;
pStretchRen = null;
pRasRen = null;
pRamp = null;
pToColor = null;
pFromColor = null;
}