Пример #1
0
 // Binary Code
 private void button1_Click(object sender, EventArgs e)
 {
     if (markFlag)
     {
         // 還原
         pcxGray = new ImgPcx(pcxBackup);
         // 浮水印處理
         pcxGray.Watermark(pcxMark, "binary");
         pictureBox10.Image = pcxGray.pcxImg;
         label1.Text        = "Original Image";
         label2.Text        = "WaterMark Inserted";
         // 顯示SNR值 (到小數後2位)
         label3.Visible   = true;
         textBox1.Visible = true;
         textBox1.Text    = pcxBackup.GetSNR(pcxBackup, pcxGray).ToString("f2");
     }
     pictureBox1.Image = pcxGray.BitPlane(128, "binary");  // 2^7
     pictureBox2.Image = pcxGray.BitPlane(64, "binary");
     pictureBox3.Image = pcxGray.BitPlane(32, "binary");
     pictureBox4.Image = pcxGray.BitPlane(16, "binary");
     pictureBox5.Image = pcxGray.BitPlane(8, "binary");
     pictureBox6.Image = pcxGray.BitPlane(4, "binary");
     pictureBox7.Image = pcxGray.BitPlane(2, "binary");
     pictureBox8.Image = pcxGray.BitPlane(1, "binary");    // 2^0
 }