• 创建面注记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);

  • 相关阅读:
    TVM量化代码解析
    如何在 GPU 上优化卷积
    全文翻译(全文合集):TVM: An Automated End-to-End Optimizing Compiler for Deep Learning
    全文翻译(四) TVM An Automated End-to-End Optimizing Compiler
    全文翻译(三) TVM An Automated End-to-End Optimizing Compiler
    全文翻译(二): TVM: An Automated End-to-End Optimizing Compiler for Deep Learning
    全文翻译(一):TVM: An Automated End-to-End Optimizing Compiler for Deep Learning
    pytorch使用gpu加速的方法
    springboot的实践1
    带你玩转stackOverflow-3
  • 原文地址:https://www.cnblogs.com/jhlong/p/5394325.html
Copyright © 2020-2023  润新知