private void EncodeFileBtn_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); DialogResult res = openFileDialog.ShowDialog(); if (res == DialogResult.OK) { huffmanResults = GenerateHuffmanEverythingSteps(File.ReadAllBytes(openFileDialog.FileName)); currentStep = 0; UpdateStepLbl(); DisplayPic.Refresh(); } }
private void PreviousStepBtn_Click(object sender, EventArgs e) { if (huffmanResults == null) { return; } if (currentStep - 1 >= 0) { currentStep--; } UpdateStepLbl(); DisplayPic.Refresh(); }
private void NextStepBtn_Click(object sender, EventArgs e) { if (huffmanResults == null) { return; } if (currentStep + 1 < huffmanResults.steps.Count) { currentStep++; } UpdateStepLbl(); DisplayPic.Refresh(); }
private void EncodeNewFileBtn_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); DialogResult res = openFileDialog.ShowDialog(); if (res == DialogResult.OK) { huffmanResults.steps.Clear(); string resultingString = HuffmanEncode(File.ReadAllBytes(openFileDialog.FileName), huffmanResults); HuffmanDecode(huffmanResults, resultingString); currentStep = 0; UpdateStepLbl(); DisplayPic.Refresh(); } }
private void ASCIIChk_CheckedChanged(object sender, EventArgs e) { useASCII = ASCIIChk.Checked; DisplayPic.Refresh(); }