Ejemplo n.º 1
0
 private void openToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (openFileDialog1.ShowDialog() == DialogResult.OK)
     {
         myTiff.from(openFileDialog1.FileName);
         player.open(myTiff);
         player.OnPlay(new MyPlayer.PlayEventArgs(0, MyPlayer.PlayState.STOP));
         if (compresser != null)
         {
             compresser.shutDown();
         }
         compresser = new MyCompresser(player, pictureBox2);
         Debug.Print("compress mode : " + compressMethod.ToString());
         compresser.setCompressMethod(compressMethod);
         compresser.setCriteriaMethod(criteria);
         compresser.connect(pictureBoxFeature, MyCompresser.CONNECT.PICTURE_FEATURE);
         compresser.connect(pictureBoxFeatureRef, MyCompresser.CONNECT.PICTURE_MATCH);
         compresser.connect(pictureBoxMotion, MyCompresser.CONNECT.PICTURE_MOTION);
         compresser.connect(trackBar1);
         compresser.connect(this, saveFileDialog1);
         if (checkBox1.Checked)
         {
             MyCompresser.sleepTime = MyCompresser.sleepLong;;
             if (compresser != null)
             {
                 compresser.ReferencePlayer.flashIgnore = false;
             }
             pictureBoxFeatureRef.Visible = true;
         }
         if (checkBox2.Checked)
         {
             pictureBoxMotion.Visible = true;
             pictureBox2.Visible      = false;
         }
         compresser.CurrentPlayer.flashIgnore = false;
         button1.Enabled         = true;
         groupBox3.Enabled       = true;
         textBox_progress.Text   = "0 / " + (myTiff.Size - 1);
         compresser.BB_THRESHOLD = trackBar2.Value;
     }
 }
Ejemplo n.º 2
0
 private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
 {
     button1.Enabled   = true;
     groupBox3.Enabled = true;
     compresser        = null;
 }