internal virtual void delImage(object btn, EventArgs e) { if (image != null) { mapView.RemoveImage(image); image.Dispose(); image = null; } ((Button)btn).Text = "Add image"; ((Button)btn).Click -= delImage; ((Button)btn).Click += addImage; }
internal virtual void addImage(object btn, EventArgs e) { Bitmap bmp = mapView.ImageManager.Open("arrow-maphint.svgpb", 1, 0); image = mapView.DisplayImage(bmp); image.Offset = new MapPoint(bmp.Width, bmp.Height / 2); image.RotatesWithMap = true; image.Angle = (float)new Random(360).NextDouble(); image.Position = mapView.MapCenter; ((Button)btn).Text = "Move image"; ((Button)btn).Click -= addImage; ((Button)btn).Click += moveImage; }