コード例 #1
0
 public void UndoWin()
 {
     if (File.Exists(localdir + Current.MapName + jsonloc))
     {
         List <Coords> points;
         points = DrawMap.Read(Current.MapName);
         DrawMap.SaveCoords(DrawMap.UndoCoords(points), Current.MapName);
         GenerateHeatMap();
     }
 }
コード例 #2
0
        public void AddWin(int x, int y)
        {
            List <Coords> points;

            if (!File.Exists(localdir + Current.MapName + jsonloc))
            {
                //textboxett.Text = "Missing wins";
                points = new List <Coords>();
            }
            else
            {
                points = DrawMap.Read(Current.MapName);
            }

            /*for (int i = 0; i < 50; i++)
             *  DrawMap.AddCoords(points, i+50, i+50);*/
            DrawMap.SaveCoords(DrawMap.AddCoords(points, x, y), Current.MapName);
            GenerateHeatMap();
        }
コード例 #3
0
        public void GenerateHeatMap()
        {
            if (!File.Exists(localdir + Current.MapName + jsonloc))
            {
                return;
            }
            Bitmap bmp = new Bitmap(width, height);

            string Name = "heatmap1";

            System.Drawing.Color temp;

            if (index == 0)
            {
                temp = System.Drawing.Color.Red;
            }
            else
            {
                temp = System.Drawing.Color.Green;
            }

            DrawMap.DrawCoords(bmp, DrawMap.Read(Current.MapName), temp);

            bmp.Save(localdir + "\\" + Name + ".bmp");                                               // save "heat"

            Uri uri = new Uri(localdir + "/Resources/" + Current.MapDir + ".png", UriKind.Relative); // load current map

            string stringUri;

            stringUri = uri.ToString();

            Bitmap bump   = ConvertToBitmap((stringUri));     // Convert loaded image
            Bitmap merged = MergedBitmaps(bmp, bump);         // Merge images

            Load_Image(merged, OutputName + Current.MapName); // using streams to avoid read/write issues

            //textboxett.Text = "GenerateHeatMap Done";
        }