private void button1_Click(object sender, EventArgs e) { float[,] kernel = new float[dataGridView1.RowCount, dataGridView1.ColumnCount]; for (int i = 0; i < dataGridView1.RowCount; i++) { for (int j = 0; j < dataGridView1.ColumnCount; j++) { if (dataGridView1.Rows[i].Cells[j].Style.BackColor == Color.Black) { kernel[i, j] = 1; } else { kernel[i, j] = 0; } } } MathMorfology.createMathMorfKernel(kernel); Close(); }
private void Form1_Load(object sender, EventArgs e) { MathMorfology.createMathMorfKernel(); }