• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RgbColorClass类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中RgbColorClass的典型用法代码示例。如果您正苦于以下问题:C# RgbColorClass类的具体用法?C# RgbColorClass怎么用?C# RgbColorClass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RgbColorClass类属于命名空间,在下文中一共展示了RgbColorClass类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
        }
开发者ID:chinasio,项目名称:Control,代码行数:34,代码来源:frm3DAnalyst.cs


示例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();
        }
开发者ID:gdherbert,项目名称:developer-support,代码行数:26,代码来源:RenderingPolyline.cs


示例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);
       
        }
开发者ID:gistop,项目名称:aegis,代码行数:60,代码来源:Datamanagement.cs


示例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;
 }
开发者ID:xfgxfg,项目名称:CropWatchField,代码行数:8,代码来源:RasterRender.cs


示例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;
 }
开发者ID:ismethr,项目名称:gas-geological-map,代码行数:8,代码来源:ColorHelper.cs


示例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;
 }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:8,代码来源:GraphicsHelper.cs


示例7: ConvertColorToIColor

        public IColor ConvertColorToIColor(Color color)
        {
            IColor pColor = new RgbColorClass();

            pColor.RGB = color.B * 65536 + color.G * 256 + color.R;

            return pColor;
        }
开发者ID:Krystal001025,项目名称:temp,代码行数:8,代码来源:SymbolSelectorFrm.cs


示例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;
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:9,代码来源:ColorSelection.cs


示例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;
 }
开发者ID:LooWooTech,项目名称:Traffic,代码行数:9,代码来源:DisplayHelper.cs


示例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;
 }
开发者ID:dalinhuang,项目名称:CUIT3D,代码行数:9,代码来源:MainPage.xaml.cs


示例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;
 }
开发者ID:weigiser,项目名称:AOProjects,代码行数:9,代码来源:SymbolHelperClass.cs


示例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;
        }
开发者ID:nazzal88,项目名称:ares,代码行数:15,代码来源:Display.cs


示例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;
 }
开发者ID:BGCX261,项目名称:ziggis-svn-to-git,代码行数:10,代码来源:Utilities.cs


示例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;
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:12,代码来源:ColorUtilities.cs


示例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;
        }
开发者ID:ismethr,项目名称:gas-geological-map,代码行数:57,代码来源:MakeContours.cs


示例16: GetColor

        public static IColor GetColor()
        {
            if (_color == null)
            {
                IRgbColor rgbColor = new RgbColorClass();
                rgbColor.Red = 255;
                rgbColor.Green = 0;
                rgbColor.Blue = 0;

                _color = rgbColor as IColor;
            }
            return _color;
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:13,代码来源:ColorSelection.cs


示例17: SetResults

 public void SetResults(IEnumNetEID edgeEnumNetEID, IEnumNetEID juncEnumNetEID, bool asSelection, INetworkAnalysisExt netAnalExt, Color namedColor)
 {
     INetworkAnalysisExtResults netAnalResults = (INetworkAnalysisExtResults)_netAnalExt;
         IRgbColor rgbColor = new RgbColorClass();
         rgbColor.Red = namedColor.R;
         rgbColor.Blue = namedColor.B;
         rgbColor.Green = namedColor.G;
         netAnalResults.ResultsAsSelection = asSelection;
         netAnalResults.DrawComplex = true;
         INetworkAnalysisExtResultColor netAnalColor = (INetworkAnalysisExtResultColor)netAnalExt;
         netAnalColor.Color = rgbColor;
         netAnalResults.SetResults(juncEnumNetEID, edgeEnumNetEID);
 }
开发者ID:RiverTaig,项目名称:FindFeederWeb,代码行数:13,代码来源:DoTrace.cs


示例18: GetRGBColor

        //���ำ������
        private IRgbColor GetRGBColor(int R, int G, int B)
        {
            IRgbColor pRGB;

            pRGB = new RgbColorClass();

            pRGB.Red = R;

            pRGB.Green = G;

            pRGB.Green = B;

            return pRGB;
        }
开发者ID:esrichina,项目名称:Engine10DevApplication,代码行数:15,代码来源:SimpleRender.cs


示例19: GetRgb

        public IRgbColor GetRgb(int r, int g, int b)
        {
            IRgbColor pRGB;

            pRGB = new RgbColorClass();

            pRGB.Red = r;

            pRGB.Green = g;

            pRGB.Blue = b;

            return pRGB;
        }
开发者ID:esrichina,项目名称:Engine10DevApplication,代码行数:14,代码来源:ChartRender.cs


示例20: MainForm_Load

        private void MainForm_Load(object sender, EventArgs e)
        {        
            m_mapControl = (IMapControl3) axMapControl1.Object;

            //relative file path to the sample data from EXE location
            string filePath = @"..\..\..\data\USAMajorHighways";
 
            //Add Lakes layer
            IWorkspaceFactory workspaceFactory = new ShapefileWorkspaceFactoryClass();
            IFeatureWorkspace workspace = (IFeatureWorkspace)workspaceFactory.OpenFromFile(filePath, axMapControl1.hWnd);
            IFeatureLayer featureLayer = new FeatureLayerClass();
            featureLayer.Name = "Lakes";
            featureLayer.Visible = true;
            featureLayer.FeatureClass = workspace.OpenFeatureClass("us_lakes");

            #region create a SimplerRenderer
            IRgbColor color = new RgbColorClass();
            color.Red = 190;
            color.Green = 232;
            color.Blue = 255;

            ISimpleFillSymbol sym = new SimpleFillSymbolClass();
            sym.Color = color;

            ISimpleRenderer renderer = new SimpleRendererClass();
            renderer.Symbol = sym as ISymbol;
            #endregion

            ((IGeoFeatureLayer)featureLayer).Renderer = renderer as IFeatureRenderer;
            axMapControl1.Map.AddLayer((ILayer)featureLayer);

            //Add Highways layer
            featureLayer = new FeatureLayerClass();
            featureLayer.Name = "Highways";
            featureLayer.Visible = true;
            featureLayer.FeatureClass = workspace.OpenFeatureClass("usa_major_highways");
            axMapControl1.Map.AddLayer((ILayer)featureLayer);

            //******** Important *************
            //store a reference to this form (Mainform) using the EditHelper class
            EditHelper.TheMainForm = this;
            EditHelper.IsEditorFormOpen = false;

            //add the EditCmd command to the toolbar
            axEditorToolbar.AddItem("esriControls.ControlsOpenDocCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axEditorToolbar.AddItem("esriControls.ControlsSaveAsDocCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axEditorToolbar.AddItem("esriControls.ControlsAddDataCommand", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
            axEditorToolbar.AddItem(new EditCmd(), 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
             
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:50,代码来源:MainForm.cs



注:本文中的RgbColorClass类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# RhetosTestContainer类代码示例发布时间:2022-05-24
下一篇:
C# Rfc2898DeriveBytes类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap