示例#1
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || pictureBox1.Image == null)
            {
                return;
            }
            string       str    = "";
            DialogResult result = MyDialog.ShowInputBox("이미지 수", "생성할 이미지 수 (999999 이하)", ref str);

            if (result.Equals(DialogResult.OK))
            {
                Regex regex = new Regex("[0-9]{1,}");
                try
                {
                    int count = Int32.Parse(regex.Match(str).Value);
                    if (count > 999999)
                    {
                        count = 999999;
                    }

                    using (StreamWriter outputFile = new StreamWriter(textBox1.Text + "/label.csv"))
                    {
                        for (int i = 0; i < count; i++)
                        {
                            Tuple <Image, string> tup = GetGenerateImage();
                            Image  image   = tup.Item1;
                            string imgName = textBox1.Text + "/image_" + String.Format("{0:000000}", i) + ".jpg";
                            image.Save(imgName);

                            outputFile.WriteLine(imgName + tup.Item2);
                        }
                    }
                    MyDialog.ShowMessageBox("완료", "(" + count + ") 이미지 생성 완료");
                }catch (System.FormatException)
                {
                }
            }
        }
 private void RegexToolStripMenuItem_Click(object sender, EventArgs e)
 {
     MyDialog.ShowInputBox("정규표현식", "Regular_expression", ref regex);
     rxrdg     = new RegularExpressionDataGenerator.RegExpDataGenerator(regex);
     this.Text = rxrdg.Next();
 }
示例#3
0
 private void button6_Click(object sender, EventArgs e)
 {
     MyDialog.ShowImageBox(GetGenerateImage().Item1);
 }