Exemplo n.º 1
0
        private void GenerateButton_Click(object sender, EventArgs e)
        {
            int xSize = Convert.ToInt32(XSizeField.Text);
            int ySize = Convert.ToInt32(YSizeField.Text);
            int seed  = m_rand.Next();

            PicMaker p = new PicMaker(xSize, ySize, seed);

            m_image            = new Bitmap(xSize, ySize);
            m_image            = p.CreatePicThread();
            ResultsBox.Image   = m_image;
            LastSeedLabel.Text = Convert.ToString(seed);
        }
Exemplo n.º 2
0
        void SaveABunchThread()
        {
            int xSize = Convert.ToInt32(XSizeField.Text);
            int ySize = Convert.ToInt32(YSizeField.Text);

            DateTime currentDate = DateToSaveField.Value;

            while (!(currentDate.DayOfWeek == DayOfWeek.Saturday || currentDate.DayOfWeek == DayOfWeek.Sunday))
            {
                currentDate = currentDate.AddDays(1);
            }

            for (int i = 0; i < Convert.ToInt32(NumberToSaveField.Text); i++)
            {
                int seed = m_rand.Next();

                Bitmap   thisImage = new Bitmap(xSize, ySize);
                PicMaker p         = new PicMaker(xSize, ySize, seed);
                thisImage = p.CreatePicThread();
                //LastSeedLabel.Text = Convert.ToString(seed);

                string filename = m_basePath + Path.DirectorySeparatorChar + currentDate.ToString("yyyyMMdd");
                thisImage.Save(filename + ".png");
                WriteSeedData(DateTime.Now, seed);

                Image thumbnail = thisImage.GetThumbnailImage(xSize / 4, ySize / 4, null, new IntPtr());
                thumbnail.Save(filename + "_thumb.png");

                // Next day
                currentDate = currentDate.AddDays(1);

                while (!(currentDate.DayOfWeek == DayOfWeek.Saturday || currentDate.DayOfWeek == DayOfWeek.Sunday))
                {
                    currentDate = currentDate.AddDays(1);
                }

                m_image          = thisImage;
                ResultsBox.Image = m_image;
            }
        }