private void ClearAll() { NeiroGraphUtils.ClearImage(pictureBox1); NeiroGraphUtils.ClearImage(pictureBox2); NeiroGraphUtils.ClearImage(pictureBox3); label2.Text = "Введіть коррекний символ"; }
private void Button4_Click(object sender, EventArgs e) { string[] ls = File.ReadAllLines(F, Encoding.GetEncoding(1251)); if (ls.Length == 0) { return; } var newItems = new List <string>(); foreach (var i in ls) { if (!newItems.Contains(i.ToString())) { newItems.Add(i.ToString()); } } foreach (var i in newItems) { NeiroGraphUtils.DrawLitera(pictureBox1.Image, i); textBox2.Text = i.ToString(); Learn(); ClearAll(); } ClearAll(); MessageBox.Show("Виконано"); }
private void PictureBox1_Leave(object sender, EventArgs e) { if (radioButton1.Checked == true) { int[,] clipArr = NeiroGraphUtils.CutImageToArray((Bitmap)pictureBox1.Image, new Point(pictureBox1.Width, pictureBox1.Height)); if (clipArr == null) { return; } arr = NeiroGraphUtils.LeadArray(clipArr, new int[NeiroWeb.neironInArrayWidth, NeiroWeb.neironInArrayHeight]); pictureBox2.Image = new Bitmap(NeiroGraphUtils.GetBitmapFromArr(clipArr), new Size(pictureBox2.Width, pictureBox2.Height));; pictureBox3.Image = new Bitmap(NeiroGraphUtils.GetBitmapFromArr(arr), new Size(pictureBox3.Width, pictureBox3.Height)); string s = neiro.CheckLetter(arr); NeiroGraphUtils.ClearImage(pictureBox1); textBox1.Text += s; } }
private void Learn() { int[,] clipArr = NeiroGraphUtils.CutImageToArray((Bitmap)pictureBox1.Image, new Point(pictureBox1.Width, pictureBox1.Height)); if (clipArr == null) { return; } arr = NeiroGraphUtils.LeadArray(clipArr, new int[NeiroWeb.neironInArrayWidth, NeiroWeb.neironInArrayHeight]); pictureBox2.Image = new Bitmap(NeiroGraphUtils.GetBitmapFromArr(clipArr), new Size(pictureBox2.Width, pictureBox2.Height));; pictureBox3.Image = new Bitmap(NeiroGraphUtils.GetBitmapFromArr(arr), new Size(pictureBox3.Width, pictureBox3.Height)); if (textBox2.Text == " " || textBox2.Text == "Введіть ваш символ...") { label2.Text = "Введіть коррекний символ"; label2.Visible = true; return; } else { label2.Text = "Символ " + "'" + textBox2.Text + "'" + " збережено!"; label2.Visible = true; neiro.SetTraining(textBox2.Text, arr); NeiroGraphUtils.ClearImage(pictureBox1); } }
private void Form1_Load(object sender, EventArgs e) { NeiroGraphUtils.ClearImage(pictureBox1); neiro = new NeiroWeb(); textBox1.Text = ""; }