当前位置: 首页>>代码示例>>C#>>正文


C# SimpleFillSymbolClass类代码示例

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


SimpleFillSymbolClass类属于命名空间,在下文中一共展示了SimpleFillSymbolClass类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: createSimpleFillSymbol

        /// <summary>
        /// 简单渲染
        /// </summary>
        /// <param name="layerName">图层名字</param>
        /// <param name="FillStyle">FillStyle</param>
        /// <param name="pColor">FillColor</param>
        /// <param name="OutLineColor">OutLineColor</param>
        /// <param name="RenderLabel">样式名称注释</param>
        /// <param name="Descripition">描述</param>
        public void createSimpleFillSymbol(string layerName, esriSimpleFillStyle FillStyle, IColor pColor, IColor OutLineColor, string RenderLabel, string Descripition)
        {
            //简单填充符号
            ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbolClass();
            //可以用符号选择器进行
            simpleFillSymbol.Style = FillStyle;
            simpleFillSymbol.Color = pColor;
            //创建边线符号
            ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();
            simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
            simpleLineSymbol.Color = OutLineColor;
            ISymbol symbol = simpleLineSymbol as ISymbol;
            symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
            simpleFillSymbol.Outline = simpleLineSymbol;

            ISimpleRenderer simpleRender = new SimpleRendererClass();
            simpleRender.Symbol = simpleFillSymbol as ISymbol;
            simpleRender.Label = RenderLabel;
            simpleRender.Description = Descripition;

            IGeoFeatureLayer geoFeatureLayer;
            geoFeatureLayer = getGeoLayer(layerName);
            if (geoFeatureLayer != null)
            {
                geoFeatureLayer.Renderer = simpleRender as IFeatureRenderer;
            }
        }
开发者ID:gistop,项目名称:aegis,代码行数:36,代码来源:Thematicmap.cs

示例2: okButton_Click

        // Save config and exit.
        private void okButton_Click(object sender, EventArgs e)
        {
            try
            {
                ISimpleFillSymbol selectionSymbol = new SimpleFillSymbolClass();
                selectionSymbol.Color = selFillColorPaletteButton.Color;
                selectionSymbol.Color.Transparency = Convert.ToByte(255 - Convert.ToDouble(selTranNumericUpDown.Value) * 2.55);
                ISimpleLineSymbol selectionOutlineSymbol = new SimpleLineSymbolClass();
                selectionOutlineSymbol.Color = selOutlineColorPaletteButton.Color;
                selectionOutlineSymbol.Width = Convert.ToDouble(selOutlineWidthNumericUpDown.Value);
                selectionSymbol.Outline = selectionOutlineSymbol;
                Config.SelectionSmbol = selectionSymbol;

                ISimpleFillSymbol editSymbol = new SimpleFillSymbolClass();
                editSymbol.Color = editFillColorColorPaletteButton.Color;
                editSymbol.Color.Transparency = Convert.ToByte(255 - Convert.ToDouble(editTranNumericUpDown.Value) * 2.55);
                ISimpleLineSymbol editOutlineSymbol = new SimpleLineSymbolClass();
                editOutlineSymbol.Color = editOutlineColorPaletteButton.Color;
                editOutlineSymbol.Width = Convert.ToDouble(editOutlineWidthNumericUpDown.Value);
                editSymbol.Outline = editOutlineSymbol;
                Config.EditSymbol = editSymbol;
                Config.CustormEditColor = editCustomCheckBox.Checked;

                Config.Save();
                Editor.Refresh();
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format("Unfortunately, the application meets an error.\n\nSource: {0}\nSite: {1}\nMessage: {2}", ex.Source, ex.TargetSite, ex.Message), "Error");
            }
        }
开发者ID:nazzal88,项目名称:ares,代码行数:33,代码来源:OptionForm.cs

示例3: ClassifyRenderer

        public static IRasterRenderer ClassifyRenderer(IRasterLayer raslyr,IRgbColor start_clr,IRgbColor end_clr,int count)
        {
            IRasterClassifyColorRampRenderer pRClassRend = new RasterClassifyColorRampRendererClass();
            IRasterRenderer rasterRenderer = pRClassRend as IRasterRenderer;

            IRaster pRaster = raslyr.Raster;
            IRasterBandCollection pRBandCol = pRaster as IRasterBandCollection;
            IRasterBand pRBand = pRBandCol.Item(0);
            if (pRBand.Histogram == null)
            {
                pRBand.ComputeStatsAndHist();
            }
            rasterRenderer.Raster = pRaster;
            pRClassRend.ClassCount = count;
            rasterRenderer.Update();

            IAlgorithmicColorRamp colorRamp = new AlgorithmicColorRampClass();
            colorRamp.Size = count;
            colorRamp.FromColor = start_clr;
            colorRamp.ToColor = end_clr;
            bool createColorRamp;
            colorRamp.CreateRamp(out createColorRamp);

            IFillSymbol fillSymbol = new SimpleFillSymbolClass();
            for (int i = 0; i < pRClassRend.ClassCount; i++)
            {
                fillSymbol.Color = colorRamp.get_Color(i);
                pRClassRend.set_Symbol(i, fillSymbol as ISymbol);
                pRClassRend.set_Label(i, pRClassRend.get_Break(i).ToString("0.00"));
            }
            return rasterRenderer;
        }
开发者ID:niwho,项目名称:ArcGISFundation,代码行数:32,代码来源:LayerHelper.cs

示例4: button1_Click

 //简单渲染专题图
 private void button1_Click(object sender, EventArgs e)
 {
     //简单填充符号
     ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbolClass();
     simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSDiagonalCross;
     simpleFillSymbol.Color = getRGB(255, 0, 0);
     //创建边线符号
     ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();
     simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSDashDotDot;
     simpleLineSymbol.Color = getRGB(0, 255, 0);
     ISymbol symbol = simpleLineSymbol as ISymbol;
     symbol.ROP2 = esriRasterOpCode.esriROPNotXOrPen;
     simpleFillSymbol.Outline = simpleLineSymbol;
     ISimpleRenderer simpleRender = new SimpleRendererClass();
     simpleRender.Symbol = simpleFillSymbol as ISymbol;
     simpleRender.Label = "NAME";
     simpleRender.Description = "东丰县行政区域";
     IGeoFeatureLayer geoFeatureLayer;
     geoFeatureLayer = getGeoLayer("东丰县行政区域");
     if (geoFeatureLayer != null)
     {
         geoFeatureLayer.Renderer = simpleRender as IFeatureRenderer;
     }
     this.axMapControl1.Refresh();
 }
开发者ID:AgentWord,项目名称:SiPing,代码行数:26,代码来源:mapphoto.cs

示例5: get_SimplePolygonSymbol

 public static ISimpleFillSymbol get_SimplePolygonSymbol(IColor color, esriSimpleFillStyle style, ILineSymbol outline)
 {
     ISimpleFillSymbol theReturn = new SimpleFillSymbolClass();
     theReturn.Color = color;
     theReturn.Style = style;
     theReturn.Outline = outline;
     return theReturn;
 }
开发者ID:EAWCS1,项目名称:SUITT,代码行数:8,代码来源:GraphicsHelper.cs

示例6: CreateFillSymbol

 public static IFillSymbol CreateFillSymbol(Color fillColor, esriSimpleFillStyle eFillStyle, ISimpleLineSymbol aOutline)
 {
     SimpleFillSymbolClass class2 = new SimpleFillSymbolClass();
     class2.Style = eFillStyle;
     class2.Color = ColorHelper.CreateColor(fillColor);
     class2.Outline = aOutline;
     return class2;
 }
开发者ID:ismethr,项目名称:gas-geological-map,代码行数:8,代码来源:SymbolHelper.cs

示例7: 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

示例8: GetPaintSymbol

        /// <summary>
        /// Get the paint symble of painted pixel.
        /// </summary>
        /// <param name="filledColor">Fill color for the symbol</param>
        /// <returns></returns>
        public static ISimpleFillSymbol GetPaintSymbol(IColor filledColor)
        {
            ISimpleFillSymbol selectionSymbol = new SimpleFillSymbolClass();
            selectionSymbol.Color = filledColor;
            ISimpleLineSymbol selectionOutlineSymbol = new SimpleLineSymbolClass();
            selectionOutlineSymbol.Color = new RgbColorClass() { Red = 255, Green = 255, Blue = 0 };
            selectionOutlineSymbol.Width = 2;
            selectionSymbol.Outline = selectionOutlineSymbol;

            return selectionSymbol;
        }
开发者ID:nazzal88,项目名称:ares,代码行数:16,代码来源:Painter.cs

示例9: 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();
        }
开发者ID:esrichina,项目名称:Engine10DevApplication,代码行数:52,代码来源:ProPortialRender.cs

示例10: ConstructMultiPatchElement

        public static IElement ConstructMultiPatchElement(IGeometry geometry, IColor color)
        {
            ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbolClass();
            simpleFillSymbol.Color = color;

            IElement element = new MultiPatchElementClass();
            element.Geometry = geometry;

            IFillShapeElement fillShapeElement = element as IFillShapeElement;
            fillShapeElement.Symbol = simpleFillSymbol;

            return element;
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:13,代码来源:ElementUtilities.cs

示例11: SetLayerColor

        public static void SetLayerColor(IGeoFeatureLayer geolyr, int r, int g, int b)
        {
            //ILineSymbol pLineSymbol = new SimpleLineSymbolClass();
            //pLineSymbol.Color = CvtRGB(r, g, b);

            ISimpleFillSymbol pFillSymbol = new SimpleFillSymbolClass();
            pFillSymbol.Color = CvtRGB(r, g, b);
            //pFillSymbol.Outline = pLineSymbol;

            ISimpleRenderer pSimpleRenderer;
            pSimpleRenderer = new SimpleRendererClass();
            pSimpleRenderer.Symbol = (ISymbol)pFillSymbol;
            geolyr.Renderer = pSimpleRenderer as IFeatureRenderer;
        }
开发者ID:niwho,项目名称:ArcGISFundation,代码行数:14,代码来源:LayerHelper.cs

示例12: 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

示例13: SimpleRender

        public SimpleRender(AxMapControl pMapcontrol, IFeatureLayer pFtLayer, String Field)
        {
            IGeoFeatureLayer pGeolayer;

            IActiveView pActiveView;

            pGeolayer = pFtLayer as IGeoFeatureLayer;

            pActiveView = pMapcontrol.ActiveView;

            IFillSymbol pFillSymbol;

            ILineSymbol pLineSymbol;

            pFillSymbol = new SimpleFillSymbolClass();

            pFillSymbol.Color = GetRGBColor(220, 110, 200);

            pLineSymbol = new SimpleLineSymbolClass();

            pLineSymbol.Color = GetRGBColor(255, 120, 105);

            pLineSymbol.Width = 2;

            pFillSymbol.Outline = pLineSymbol;

            ISimpleRenderer pSimpleRender;//��ʲô������Ⱦ

            pSimpleRender = new SimpleRendererClass();

            pSimpleRender.Symbol = pFillSymbol as ISymbol ;

            pSimpleRender.Description = "China";

            pSimpleRender.Label = "SimpleRender";

            ITransparencyRenderer pTrans;

            pTrans = pSimpleRender as ITransparencyRenderer;

            pTrans.TransparencyField = Field;

            pGeolayer.Renderer = pTrans as IFeatureRenderer;

            pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, null, null);

            //����ͼ�����Ⱦ������һ��Ҫ����Ⱦ���󣬶������������һЩ��ض�����ɵġ�
            //����Ҳ��һ������˵�����������С������ɵġ�
        }
开发者ID:esrichina,项目名称:Engine10DevApplication,代码行数:49,代码来源:SimpleRender.cs

示例14: OnClick

        protected override void OnClick()
        {
            try
            {
                IMxDocument mxDoc = ArcMap.Document;
                IMap map = mxDoc.FocusMap;
                IGraphicsContainer graphicsCon = map as IGraphicsContainer;
                graphicsCon.Reset();
                IElement element = graphicsCon.Next();

                IRgbColor red = new RgbColor();
                red.Blue = 0;
                red.Green = 0;
                red.Red = 255;

                IRgbColor green = new RgbColor();
                green.Blue = 0;
                green.Green = 255;
                green.Red = 0;

                ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass();
                fillSymbol.Color = green;
                fillSymbol.Outline.Color = red; // This change did not change the outline color in the display (a bug at 10.1)
                fillSymbol.Outline.Width = 3.0; // // This change did not change the outline width in the display (a bug at 10.1)

                // For assigning the symbol
                // --------------------------------------------------------------------------------

                (element as IFillShapeElement).Symbol = fillSymbol;

                // --------------------------------------------------------------------------------

                graphicsCon.DeleteAllElements();
                (graphicsCon as IActiveView).Refresh();

                graphicsCon.AddElement(element, 0);

                (graphicsCon as IActiveView).Refresh();
            }

            catch (Exception myEx)
            {
                System.Diagnostics.Debug.WriteLine(myEx.Message + " " + myEx.Source.ToString());
            }

            ArcMap.Application.CurrentTool = null;
        }
开发者ID:ApexGIS,项目名称:developer-support,代码行数:47,代码来源:btn.cs

示例15: AddGraphicToMap

        ///<summary>Draw a specified graphic on the map using the supplied colors.</summary>
        ///      
        ///<param name="map">An IMap interface.</param>
        ///<param name="geometry">An IGeometry interface. It can be of the geometry type: esriGeometryPoint, esriGeometryPolyline, or esriGeometryPolygon.</param>
        ///<param name="rgbColor">An IRgbColor interface. The color to draw the geometry.</param>
        ///<param name="outlineRgbColor">An IRgbColor interface. For those geometry's with an outline it will be this color.</param>
        ///      
        ///<remarks>Calling this function will not automatically make the graphics appear in the map area. Refresh the map area after after calling this function with Methods like IActiveView.Refresh or IActiveView.PartialRefresh.</remarks>
        public void AddGraphicToMap(IMap map, IGeometry geometry, IRgbColor rgbColor, IRgbColor outlineRgbColor)
        {
            IGraphicsContainer graphicsContainer = (IGraphicsContainer)map; // Explicit Cast
            IElement element = null;
            if ((geometry.GeometryType) == esriGeometryType.esriGeometryPoint)
            {
                // Marker symbols
                ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass();
                simpleMarkerSymbol.Color = rgbColor;
                simpleMarkerSymbol.Outline = true;
                simpleMarkerSymbol.OutlineColor = outlineRgbColor;
                simpleMarkerSymbol.Size = 15;
                simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;

                IMarkerElement markerElement = new MarkerElementClass();
                markerElement.Symbol = simpleMarkerSymbol;
                element = (IElement)markerElement; // Explicit Cast
            }
            else if ((geometry.GeometryType) == esriGeometryType.esriGeometryPolyline)
            {
                //  Line elements
                ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();
                simpleLineSymbol.Color = rgbColor;
                simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
                simpleLineSymbol.Width = 5;

                ILineElement lineElement = new LineElementClass();
                lineElement.Symbol = simpleLineSymbol;
                element = (IElement)lineElement; // Explicit Cast
            }
            else if ((geometry.GeometryType) == esriGeometryType.esriGeometryPolygon)
            {
                // Polygon elements
                ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbolClass();
                simpleFillSymbol.Color = rgbColor;
                simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSForwardDiagonal;
                IFillShapeElement fillShapeElement = new PolygonElementClass();
                fillShapeElement.Symbol = simpleFillSymbol;
                element = (IElement)fillShapeElement; // Explicit Cast
            }
            if (!(element == null))
            {
                element.Geometry = geometry;
                graphicsContainer.AddElement(element, 0);
            }
        }
开发者ID:Isolf,项目名称:CalibreerMShape,代码行数:54,代码来源:ArcObjectsHelper.cs


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