示例#1
0
        /// <summary>
        /// Initial the class.
        /// </summary>
        private void Init()
        {
            photoMosaic      = new PhotoMosaic();
            QRWriter         = new QRCodeEncoding();
            stopWatch        = new Stopwatch();
            processForm      = new ProcessForm();
            ProcessForm.main = this;
            PhotoMosaic.main = this;
            StateLabel.Text  = SrcPathLabel.Text = "";

            // Calculate avg color of tile's size : 64, 32, 16, 8
            ProcessForm.calcTileSize = Convert.ToInt32(numericUpDown1.Value);
            //tileSize = Convert.ToInt32(numericUpDown2.Value);
            this.Text             = "Photomosaic with embedded QR Code Application";
            QRCodeContentBox.Text = "Hello World!!!";
        }
示例#2
0
        private void CalcAvgBtn_Click(object sender, EventArgs e)
        {
            if (CalcAvgWorker.IsBusy || tiles.Count == 0)
            {
                return;
            }

            processForm           = new ProcessForm();
            processForm.Canceled += new EventHandler <EventArgs>(CancelTileBtn_Click);
            processForm.Show();
            // Register callback function
            cb -= processForm.CalcAvgRGB;
            cb += processForm.CalcAvgRGB;
            processForm.stringCB -= SavingFileName;
            processForm.stringCB += SavingFileName;
            stopWatch.Start();
            CalcAvgWorker.RunWorkerAsync();
            StateLabel.Text = "Calculating is done!!!";
        }
示例#3
0
 private void QRAndPhotmosaicBtn_Click(object sender, EventArgs e)
 {
     if (CreateWorker.IsBusy || masterBitmap == null)
     {
         return;
     }
     if (processForm == null)
     {
         processForm = new ProcessForm();
     }
     if (CreatingFolderPath != FolderComboBox.SelectedValue.ToString())
     {
         CreatingFolderPath = FolderComboBox.SelectedValue.ToString();
         tiles.Clear();
     }
     blockSize = Convert.ToInt32(BlockcomboBox.SelectedValue);
     version   = Convert.ToInt32(numericUpDown3.Value);
     processForm.Show();
     stopWatch.Stop();
     CreateWorker.RunWorkerAsync();
 }
示例#4
0
        /// <summary>
        /// MainForm tab page 2.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TileFolderBtn_Click(object sender, EventArgs e)
        {
            if (CalcAvgWorker.IsBusy)
            {
                return;
            }

            FolderBrowserDialog folderBrowser = new FolderBrowserDialog();

            if (folderBrowser.ShowDialog() == DialogResult.OK)
            {
                processForm           = new ProcessForm();
                processForm.Canceled += new EventHandler <EventArgs>(CancelTileBtn_Click);
                CalcAvgFolderPath     = folderBrowser.SelectedPath;
                processForm.Show();
                cb -= processForm.LoadFolder;
                cb += processForm.LoadFolder;
                processForm.stringCB -= Path;
                processForm.stringCB += Path;
                stopWatch.Start();
                CalcAvgWorker.RunWorkerAsync();
                folderBrowser.Dispose();
            }
        }