private void Button1_Click(object sender, EventArgs e) { var width = pictureBox1.Width; var height = pictureBox1.Height; var hp = new HeatMap(width, height); pictureBox1.Image = hp.MapGenerate(pictureBox1, HeatPoints); }