Beispiel #1
0
        private void AddToMap(IMapItem item)
        {
            // Draw the item image over the map.
            var pb = new PictureBox();

            pb.SizeMode  = PictureBoxSizeMode.AutoSize;
            pb.Parent    = SeaChart;
            pb.BackColor = Color.Transparent;
            pb.Image     = item.GetImage();
            pb.BringToFront();
            pb.MouseMove     += IMapItem_MouseMove;
            pb.ParentChanged += IMapItem_ParentChanged;
            pb.Location       = item.GetLocation();

            if (item.GetType() == typeof(Stamp))
            {
                pb.Tag        = "Stamp";
                pb.MouseUp   += Stamp_MouseUp;
                pb.MouseDown += Stamp_MouseDown;
            }
            else if (item.GetType() == typeof(Waypoint))
            {
                pb.Tag         = "Waypoint";
                pb.MouseUp    += Waypoint_MouseUp;
                pb.MouseEnter += Waypoint_MouseEnter;
                pb.MouseLeave += Waypoint_MouseLeave;
                pb.MouseDown  += Waypoint_MouseDown;
            }
        }
Beispiel #2
0
        private void AddToMap(IMapItem item)
        {
            // Draw the item image over the map.
            var pb = new PictureBox();

            pb.SizeMode = PictureBoxSizeMode.AutoSize;
            pb.Parent = SeaChart;
            pb.BackColor = Color.Transparent;
            pb.Image = item.GetImage();
            pb.BringToFront();
            pb.MouseMove += IMapItem_MouseMove;
            pb.ParentChanged += IMapItem_ParentChanged;
            pb.Location = item.GetLocation();

            if (item.GetType() == typeof(Stamp))
            {
                pb.Tag = "Stamp";
                pb.MouseUp += Stamp_MouseUp;
                pb.MouseDown += Stamp_MouseDown;
            }
            else if (item.GetType() == typeof(Waypoint))
            {
                pb.Tag = "Waypoint";
                pb.MouseUp += Waypoint_MouseUp;
                pb.MouseEnter += Waypoint_MouseEnter;
                pb.MouseLeave += Waypoint_MouseLeave;
                pb.MouseDown += Waypoint_MouseDown;
            }
        }