Exemple #1
0
        private void test2d_Load(object sender, EventArgs e)
        {
            SetDoubleBuffered(panel1);
            this.DoubleBuffered = true;
            this.SetStyle(ControlStyles.UserPaint |
                          ControlStyles.AllPaintingInWmPaint |
                          ControlStyles.ResizeRedraw |
                          ControlStyles.ContainerControl |
                          ControlStyles.OptimizedDoubleBuffer |
                          ControlStyles.SupportsTransparentBackColor
                          , true);
            this.UpdateStyles();
            plat = new Bitmap(Width, Height);
            List <HeatPoint> pt = new List <HeatPoint>();
            int x  = 0;
            int y  = 0;
            int mh = 0;

            while (true)
            {
                mh += 1;
                if (y > panel1.Height)
                {
                    break;
                }
                if (x > panel1.Width)
                {
                    x  = 0;
                    y += 9;
                    continue;
                }
                if (network.Run(new double[] { (double)x / (double)Width, (double)y / (double)Height })[0] < 0.5)
                {
                    pt.Add(new HeatPoint(x, y, 70));
                }
                x += 9;
            }

            Heatmap hm = new Heatmap();

            hm.CreateIntensityMask(plat, pt);
            plat = Heatmap.Colorize(plat, 255);
        }