本文整理汇总了C#中TextStyle.DrawSample方法的典型用法代码示例。如果您正苦于以下问题:C# TextStyle.DrawSample方法的具体用法?C# TextStyle.DrawSample怎么用?C# TextStyle.DrawSample使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextStyle
的用法示例。
在下文中一共展示了TextStyle.DrawSample方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawSampleCore
protected override void DrawSampleCore(GeoCanvas canvas, DrawingRectangleF drawingExtent)
{
base.DrawSampleCore(canvas, drawingExtent);
PointShape upperLeftPoint = ExtentHelper.ToWorldCoordinate(canvas.CurrentWorldExtent, drawingExtent.CenterX - drawingExtent.Width / 2, drawingExtent.CenterY - drawingExtent.Height / 2, canvas.Width, canvas.Height);
PointShape lowerRightPoint = ExtentHelper.ToWorldCoordinate(canvas.CurrentWorldExtent, drawingExtent.CenterX + drawingExtent.Width / 2, drawingExtent.CenterY + drawingExtent.Height / 2, canvas.Width, canvas.Height);
RectangleShape rectangle = new RectangleShape(upperLeftPoint, lowerRightPoint);
rectangle.ScaleDown(10);
// Here draw the points on Legend Image
Random random = new Random(DateTime.Now.Millisecond);
Collection<BaseShape> drawingPoints = new Collection<BaseShape>();
for (int i = 0; i < DrawingPointsNumber; i++)
{
double x = rectangle.LowerLeftPoint.X + random.NextDouble() * (rectangle.Width);
double y = rectangle.LowerLeftPoint.Y + random.NextDouble() * (rectangle.Height);
drawingPoints.Add(new PointShape(x, y));
}
TextStyle textStyle = new TextStyle(DrawingPointsNumber.ToString(), new GeoFont("Arial", 20, DrawingFontStyles.Bold), new GeoSolidBrush(GeoColor.FromArgb(180, GeoColor.FromHtml("#d3d3d3"))));
textStyle.DrawSample(canvas, drawingExtent);
CustomPointStyle.Draw(drawingPoints, canvas, new Collection<SimpleCandidate>(), new Collection<SimpleCandidate>());
}