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


C# Symbol.SetLineSymbol方法代码示例

本文整理汇总了C#中Symbol.SetLineSymbol方法的典型用法代码示例。如果您正苦于以下问题:C# Symbol.SetLineSymbol方法的具体用法?C# Symbol.SetLineSymbol怎么用?C# Symbol.SetLineSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symbol的用法示例。


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

示例1: DrawArc

        /**
         * 绘制弧线
         * 
         * @return 折线对象
         */
        public Graphic DrawArc()
        {
            double mLat = 39.97923;
            double mLon = 116.357428;

            int lat = (int)(mLat * 1E6);
            int lon = (int)(mLon * 1E6);
            GeoPoint pt1 = new GeoPoint(lat, lon);

            mLat = 39.94923;
            mLon = 116.397428;
            lat = (int)(mLat * 1E6);
            lon = (int)(mLon * 1E6);
            GeoPoint pt2 = new GeoPoint(lat, lon);
            mLat = 39.97923;
            mLon = 116.437428;
            lat = (int)(mLat * 1E6);
            lon = (int)(mLon * 1E6);
            GeoPoint pt3 = new GeoPoint(lat, lon);

            Geometry arcGeometry = new Geometry();

            arcGeometry.SetArc(pt1, pt3, pt2);
            // 设定样式
            Symbol arcSymbol = new Symbol();
            Symbol.Color arcColor = new Com.Baidu.Mapapi.Map.Symbol.Color(arcSymbol);
            arcColor.Red = 255;
            arcColor.Green = 0;
            arcColor.Blue = 225;
            arcColor.Alpha = 255;
            arcSymbol.SetLineSymbol(arcColor, 4);
            // 生成Graphic对象
            Graphic arcGraphic = new Graphic(arcGeometry, arcSymbol);
            return arcGraphic;
        }
开发者ID:hnhhzy,项目名称:BaiduMap_SDK_DEMO_for_Xamarin.Android,代码行数:40,代码来源:GeometryDemo.cs

示例2: DrawLine

        /**
         * 绘制折线,该折线状态随地图状态变化
         * @return 折线对象
         */
        public Graphic DrawLine()
        {
            double mLat = 39.97923;
            double mLon = 116.357428;

            int lat = (int)(mLat * 1E6);
            int lon = (int)(mLon * 1E6);
            GeoPoint pt1 = new GeoPoint(lat, lon);

            mLat = 39.94923;
            mLon = 116.397428;
            lat = (int)(mLat * 1E6);
            lon = (int)(mLon * 1E6);
            GeoPoint pt2 = new GeoPoint(lat, lon);
            mLat = 39.97923;
            mLon = 116.437428;
            lat = (int)(mLat * 1E6);
            lon = (int)(mLon * 1E6);
            GeoPoint pt3 = new GeoPoint(lat, lon);

            //构建线
            Geometry lineGeometry = new Geometry();
            //设定折线点坐标
            GeoPoint[] linePoints = new GeoPoint[3];
            linePoints[0] = pt1;
            linePoints[1] = pt2;
            linePoints[2] = pt3;
            lineGeometry.SetPolyLine(linePoints);
            //设定样式
            Symbol lineSymbol = new Symbol();
            Symbol.Color lineColor = new Com.Baidu.Mapapi.Map.Symbol.Color(lineSymbol);
            lineColor.Red = 255;
            lineColor.Green = 0;
            lineColor.Blue = 0;
            lineColor.Alpha = 255;
            lineSymbol.SetLineSymbol(lineColor, 10);
            //生成Graphic对象
            Graphic lineGraphic = new Graphic(lineGeometry, lineSymbol);
            return lineGraphic;
        }
开发者ID:hnhhzy,项目名称:BaiduMap_SDK_DEMO_for_Xamarin.Android,代码行数:44,代码来源:GeometryDemo.cs


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