private void btnEncrypt_Click(object sender, EventArgs e) { if (!ValidateInput()) { return; } imageMatrix = ImageEncComp.Encrypt( new KeyValuePair <string, int>(encryptKey, tapIdx), imageMatrix) as RGBPixel[, ]; ImageEncComp.DisplayImage(imageMatrix, pictureBox2); }
private void btnOpen_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog1 = new OpenFileDialog(); if (openFileDialog1.ShowDialog() == DialogResult.OK) { //Open the browsed image and display it string OpenedFilePath = openFileDialog1.FileName; imageMatrix = ImageEncComp.OpenImage(OpenedFilePath) as RGBPixel[, ]; ImageEncComp.DisplayImage(imageMatrix, pictureBox1); } }
private void btnFastEncAndCom_Click(object sender, EventArgs e) { if (!ValidateInput()) { return; } // TODO: refactor fast algorithms again var key = new KeyValuePair <string, int>(encryptKey, tapIdx); imageMatrix = ImageEncComp.FastEncryptionWithCompression( ref key, ref imageMatrix, ref mFrequencies) as RGBPixel[, ]; ImageEncComp.DisplayImage(imageMatrix, pictureBox2); var compressedResultObject = ImageEncComp.FastCompressionWithPreEncryption(ref imageMatrix, ref mFrequencies); SaveFile(compressedResultObject); }