Ejemplo n.º 1
0
        public void TempTest1()
        {
            using (var fileReader = new FileReader(filePathSource, new FileOperations.Buffer()))
            {
                using (var fileWriter = new FileWriter(filePathEncodedFile, new FileOperations.Buffer()))
                {
                    jpegEncoder.EncodeImage(fileReader, fileWriter, downSampler);
                    jpegEncoder.DecodeImage(downSampler, QuantizeMethod.Method2, 50);
                }
            }

            jpegEncoder.ReconstructedImage.Save(filePathDecodedFile, ImageFormat.Jpeg);
        }
        private void buttonLast4Steps_Click(object sender, EventArgs e)
        {
            QuantizeMethod quantizeMethod    = QuantizeMethod.Method2;
            int            quantizeParameter = 0;

            if (radioButtonMethod2.Checked)
            {
                quantizeMethod    = QuantizeMethod.Method2;
                quantizeParameter = (int)numericUpDownR.Value;
            }

            if (radioButtonJpegQ.Checked)
            {
                quantizeMethod    = QuantizeMethod.JpegQuality;
                quantizeParameter = (int)numericUpDownJpeg.Value;
            }

            jpegEncoder.DecodeImage(new DownSampler411(), quantizeMethod, quantizeParameter);
            pictureBoxDecodedImage.Image = jpegEncoder.ReconstructedImage;
        }