zoukankan      html  css  js  c++  java
  • 创建面注记PolygonElement

    1.根据4点创建一个面

            /// <summary>

            /// 根据4个点创建图形,点序要顺时针

            /// </summary>

            /// <param name="pnt1">点1</param>

            /// <param name="pnt2">点2</param>

            /// <param name="pnt3">点3</param>

            /// <param name="pnt4">点4</param>

            /// <returns>IPolygon</returns>

            public static IPolygon CreatePolygonBy4Points(IPoint pnt1, IPoint pnt2, IPoint pnt3, IPoint pnt4)

            {

                IPointCollection pPntCol = new PolygonClass();

                object missing = Type.Missing; ////顺时针添加 

                pPntCol.AddPoint(pnt1, ref missing, ref missing);

                pPntCol.AddPoint(pnt2, ref missing, ref missing);

                pPntCol.AddPoint(pnt3, ref missing, ref missing);

                pPntCol.AddPoint(pnt4, ref missing, ref missing);

                pPntCol.AddPoint(pnt1, ref missing, ref missing); //// 为保持首尾相联,故将第一个点再添加一次

                return pPntCol as IPolygon;

            }

    2.创建面符号

            /// <summary>

            /// 创建 面 符号

            /// </summary>

            /// <param name="r">The r.</param>

            /// <param name="g">The g.</param>

            /// <param name="b">The b.</param>

            /// <returns>ISimpleFillSymbol</returns>

            public static ISimpleFillSymbol CreateGeoSymbol(int r, int g, int b)

            {

                ISimpleFillSymbol psymbol = new SimpleFillSymbolClass() as ISimpleFillSymbol;

                psymbol.Color = ColorCustom(r, g, b);

                psymbol.Outline.Color = ColorCustom(r, g, b);

                return psymbol;

            } 

    3.创建PolygonElement

                                    IElement pele = new PolygonElementClass();

                                    pele.Geometry = pGeoCol as IGeometry;

                                    (pele as IFillShapeElement).Symbol = CreateGeoSymbol(r, gD, b);

                                    (pmap as IGraphicsContainer).AddElement(pele, 0);

  • 相关阅读:
    关于 Xcode8打印JSON的时候,NSLog控制台显示不完整
    关于Xcode8打印一堆log问题
    iOS---关于UIWebView
    iOS --- UIWebView的加载本地数据的三种方式
    关于iOS10
    iOS切图文件的命名规范
    iOS---A valid provisioning profile for this executable was not found
    iOS---用Application Loader 上传的时候报错No suitable application records were found. Verify your bundle identifier 'xx' is correct
    2020Python作业15——装饰器2+迭代器
    【2020Python修炼记21】Python语法入门—生成器
  • 原文地址:https://www.cnblogs.com/jhlong/p/5394325.html
Copyright © 2011-2022 走看看