// Gray Code private void button2_Click(object sender, EventArgs e) { if (markFlag) { // 還原 pcxGray = new ImgPcx(pcxBackup); // 浮水印處理 pcxGray.Watermark(pcxMark, "Gray"); 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, "Gray"); pictureBox2.Image = pcxGray.BitPlane(64, "Gray"); pictureBox3.Image = pcxGray.BitPlane(32, "Gray"); pictureBox4.Image = pcxGray.BitPlane(16, "Gray"); pictureBox5.Image = pcxGray.BitPlane(8, "Gray"); pictureBox6.Image = pcxGray.BitPlane(4, "Gray"); pictureBox7.Image = pcxGray.BitPlane(2, "Gray"); pictureBox8.Image = pcxGray.BitPlane(1, "Gray"); }