BMap.NET.WindowsForm/BStepStartAndEndItem.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using BMap.NET.WindowsForm.BMapElements;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace BMap.NET.WindowsForm
{
    /// <summary>
    /// 路线起点/终点控件
    /// </summary>
    partial class BStepStartAndEndItem : UserControl
    {
        public event StepEndPointSelectedEventHandler StepEndPointSelected;

        /// <summary>
        /// 起点/终点数据源
        /// </summary>
        public BPoint EndPoint
        {
            get;
            set;
        }

        /// <summary>
        /// 构造方法
        /// </summary>
        public BStepStartAndEndItem()
        {
            InitializeComponent();
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
            UpdateStyles();
        }

        /// <summary>
        /// 重绘
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BStepStartAndEndItem_Paint(object sender, PaintEventArgs e)
        {
            if (EndPoint != null)
            {
                Bitmap b = null;
                if (EndPoint.Type == PointType.RouteStart)
                {
                    b = Properties.BMap.ico_source;
                }
                if (EndPoint.Type == PointType.RouteEnd)
                {
                    b = Properties.BMap.ico_destination;
                }
                e.Graphics.DrawImage(b, new Rectangle(5, (Height - b.Height) / 2, b.Width, b.Height));
            }
        }

        /// <summary>
        /// 鼠标点击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
后面还有 19 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。