Пример #1
0
        private void LZWDecompressButton_Click_1(object sender, EventArgs e)
        {
            IFileOperationsController _fileOperationController = new FileOperationsController();
            LZWDecompress             _lzwDecompress           = new LZWDecompress(this);


            string decompressedFilePath = compressedFilePathRichTextBox.Text.Remove(compressedFilePathRichTextBox.Text.Length - 14) + "Uncompressed.txt";

            decompressedFileNameTextBox.Text = decompressedFilePath;
            _lzwDecompress.LZWDecompressFile(compressedFilePathRichTextBox.Text, decompressedFilePath, Convert.ToInt16(selectedMaxBitSizeTextbox.Text));
            decompressedByteSizeTextBox.Text = _fileOperationController.getFileByteSize(decompressedFilePath);

            compressedPercentanceTextBox.Text     = _lzwDecompress.getCompressionRatio(double.Parse(compressedByteSizeTextBox.Text), double.Parse(decompressedByteSizeTextBox.Text)) + " %";
            CompressedDataPercentanceTextBox.Text = (100 - Convert.ToDouble(compressedPercentanceTextBox.Text.Remove(compressedPercentanceTextBox.Text.Length - 2))).ToString() + " %";
        }