Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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);
        }