Demo.WindowsPresentation/Source/Map.cs
(完整代码) 1KB
namespace Demo.WindowsPresentation
{
using System.Windows.Controls;
using System.Windows.Media;
using GMap.NET.WindowsPresentation;
using System.Globalization;
using System.Windows.Forms;
using System.Windows;
using System;
/// <summary>
/// the custom map f GMapControl
/// </summary>
public class Map : GMapControl
{
public long ElapsedMilliseconds;
#if DEBUG
DateTime start;
DateTime end;
int delta;
private int counter;
readonly Typeface tf = new Typeface("GenericSansSerif");
readonly System.Windows.FlowDirection fd = new System.Windows.FlowDirection();
/// <summary>
/// any custom drawing here
/// </summary>
/// <param name="drawingContext"></param>
protected override void OnRender(DrawingContext drawingContext)
{
start = DateTime.Now;
base.OnRender(drawingContext);
end = DateTime.Now;
delta = (int)(end - start).TotalMilliseconds;
FormattedText text = new FormattedText(Zoom + "z, " + MapProvider + ", refresh: " + counter++ + ", load: " + ElapsedMilliseconds + "ms, render: " + delta + "ms", CultureInfo.CurrentUICulture, fd, tf, 20, Brushes.Blue);
drawingContext.DrawText(text, new Point(text.Height, text.Height));
text = null;
}
#endif
}
}
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
