本文整理汇总了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;
}
示例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;
}