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


C# Symbol.SetSurface方法代码示例

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


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

示例1: DrawCircle

        /**
         * 绘制圆,该圆随地图状态变化
         * @return 圆对象
         */
        public Graphic DrawCircle()
        {
            double mLat = 39.90923;
            double mLon = 116.447428;
            int lat = (int)(mLat * 1E6);
            int lon = (int)(mLon * 1E6);
            GeoPoint pt1 = new GeoPoint(lat, lon);

            //构建圆
            Geometry circleGeometry = new Geometry();

            //设置圆中心点坐标和半径
            circleGeometry.SetCircle(pt1, 2500);
            //设置样式
            Symbol circleSymbol = new Symbol();
            Symbol.Color circleColor = new Com.Baidu.Mapapi.Map.Symbol.Color(circleSymbol);
            circleColor.Red = 0;
            circleColor.Green = 255;
            circleColor.Blue = 0;
            circleColor.Alpha = 126;
            circleSymbol.SetSurface(circleColor, 1, 3, new Com.Baidu.Mapapi.Map.Symbol.Stroke(3, new Com.Baidu.Mapapi.Map.Symbol.Color(circleSymbol, Android.Graphics.Color.ParseColor("#FFFF0000").ToArgb())));
            //生成Graphic对象
            Graphic circleGraphic = new Graphic(circleGeometry, circleSymbol);
            return circleGraphic;
        }
开发者ID:hnhhzy,项目名称:BaiduMap_SDK_DEMO_for_Xamarin.Android,代码行数:29,代码来源:GeometryDemo.cs

示例2: DrawPolygon

        /**
         * 绘制多边形,该多边形随地图状态变化
         * @return 多边形对象
         */
        public Graphic DrawPolygon()
        {
            double mLat = 39.93923;
            double mLon = 116.357428;
            int lat = (int)(mLat * 1E6);
            int lon = (int)(mLon * 1E6);
            GeoPoint pt1 = new GeoPoint(lat, lon);
            mLat = 39.91923;
            mLon = 116.327428;
            lat = (int)(mLat * 1E6);
            lon = (int)(mLon * 1E6);
            GeoPoint pt2 = new GeoPoint(lat, lon);
            mLat = 39.89923;
            mLon = 116.347428;
            lat = (int)(mLat * 1E6);
            lon = (int)(mLon * 1E6);
            GeoPoint pt3 = new GeoPoint(lat, lon);
            mLat = 39.89923;
            mLon = 116.367428;
            lat = (int)(mLat * 1E6);
            lon = (int)(mLon * 1E6);
            GeoPoint pt4 = new GeoPoint(lat, lon);
            mLat = 39.91923;
            mLon = 116.387428;
            lat = (int)(mLat * 1E6);
            lon = (int)(mLon * 1E6);
            GeoPoint pt5 = new GeoPoint(lat, lon);

            //构建多边形
            Geometry polygonGeometry = new Geometry();
            //设置多边形坐标
            GeoPoint[] polygonPoints = new GeoPoint[5];
            polygonPoints[0] = pt1;
            polygonPoints[1] = pt2;
            polygonPoints[2] = pt3;
            polygonPoints[3] = pt4;
            polygonPoints[4] = pt5;
            polygonGeometry.SetPolygon(polygonPoints);
            //设置多边形样式
            Symbol polygonSymbol = new Symbol();
            Symbol.Color polygonColor = new Com.Baidu.Mapapi.Map.Symbol.Color(polygonSymbol);
            polygonColor.Red = 0;
            polygonColor.Green = 0;
            polygonColor.Blue = 255;
            polygonColor.Alpha = 126;
            polygonSymbol.SetSurface(polygonColor, 1, 5);
            //生成Graphic对象
            Graphic polygonGraphic = new Graphic(polygonGeometry, polygonSymbol);
            return polygonGraphic;
        }
开发者ID:hnhhzy,项目名称:BaiduMap_SDK_DEMO_for_Xamarin.Android,代码行数:54,代码来源:GeometryDemo.cs


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