示例#1
0
        //static readonly string jsonloc = AppDomain.CurrentDomain.BaseDirectory + "Coordinates.json";
        public MainWindow()
        {
            Maps[0] = KingsC;
            Maps[1] = WorldsE;

            Current = Maps[0];
            InitializeComponent();
        }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (sender == Change_Button)
                {
                    Current         = Maps[(++index) % 2];
                    textboxett.Text = Current.MapName;

                    Uri    uri = new Uri(localdir + "/Resources/" + Current.MapDir + ".png", UriKind.Relative); // load current mapstring stringUri;
                    string stringUri;
                    stringUri = uri.ToString();
                    Bitmap image = ConvertToBitmap((stringUri));

                    Load_Image(image, Current.MapName);
                }
                if (sender == Add_Button)
                {
                    Oh_NO.Visibility = Visibility.Visible;
                    textboxett.Text  = "Waiting for click";
                }
                if (sender == Draw_Button)
                {
                    GenerateHeatMap();
                }
                if (sender == Oh_NO)
                {
                    Oh_NO.Visibility = Visibility.Hidden;

                    System.Windows.Point p = Mouse.GetPosition(ImageView);

                    double X = p.X;
                    double Y = p.Y;
                    int    x = (int)Math.Floor(X);
                    int    y = (int)Math.Floor(Y);

                    AddWin(x, y);
                }
                if (sender == Undo_Button)
                {
                    UndoWin();
                }
            }
            catch (FileNotFoundException)
            {
                textboxett.Text = "Exception in Button_Click";
            }
        }