private void createMatrix(int mHeight, int mWidth) { int height = 50; int width = 50; int x = 30, y = 70; if (mHeight > 0 && mWidth > 0) { localMask = Morphology.createMaskList(mHeight, mWidth); } for (int i = 0; i < localMask.Count; i++) { for (int j = 0; j < localMask[i].Count; j++) { NumericUpDown numUD = new NumericUpDown(); numUD.Height = height; numUD.Width = width; numUD.Name = "numUD" + i + j; numUD.Maximum = 1; numUD.Minimum = 0; numUD.Location = new Point(x, y); numUD.Value = Convert.ToDecimal(localMask[i][j]); this.Controls.Add(numUD); x += 80; } x = 30; y += 30; } }
private void LocalMethods_Load(object sender, EventArgs e) { mask = Morphology.createMaskList(3, 3); redrawMask(); }