private void SetImage(CustomImage<ClassType> img) { if (img != null) { var watch = new Stopwatch(); watch.Start(); for (int i = 0; i < Config.Height; i++) { for (int j = 0; j < Config.Width; j++) { var val = img.PixelValue(i, j); dataGridView1.Rows[i].Cells[j].Value = val; if (val == 1) { dataGridView1.Rows[i].Cells[j].Style.BackColor = Color.DarkSeaGreen; } else { dataGridView1.Rows[i].Cells[j].Style.BackColor = Color.White; } } } watch.Stop(); } }
private void SetImage(CustomImage <ClassType> img) { if (img != null) { var watch = new Stopwatch(); watch.Start(); for (int i = 0; i < Config.Height; i++) { for (int j = 0; j < Config.Width; j++) { var val = img.PixelValue(i, j); dataGridView1.Rows[i].Cells[j].Value = val; if (val == 1) { dataGridView1.Rows[i].Cells[j].Style.BackColor = Color.DarkSeaGreen; } else { dataGridView1.Rows[i].Cells[j].Style.BackColor = Color.White; } } } watch.Stop(); } }