private void MnuSaveFile_Click(object sender, RoutedEventArgs e) { FileClass fileHandler = new FileClass(); //if bitmap exists, convert to PPM and save file if (temp != null) { PromptPpmType ppmPrompt = new PromptPpmType(); Compresser compresser = new Compresser(); Container RleContainer; Container LzwContainer; Container decompressedContainer; ConvertPPM convert = new ConvertPPM(temp); convert.File = currentPath; //get file type from user (ascii/raw) ppmPrompt.ShowDialog(); //get compressed and decompressed containers Container tempContainer = convert.BitmapConversion(ppmPrompt.ppm); RleContainer = compresser.Compress(tempContainer); LzwContainer = compresser.LzwCompression(tempContainer); decompressedContainer = tempContainer; //get the byte size of each int RleBytes = ContainerByteSize(RleContainer); int LzwBytes = ContainerByteSize(LzwContainer); int decompressedBytes = ContainerByteSize(decompressedContainer); //show comparison, choose compression ConfirmCompress popup = new ConfirmCompress(RleBytes, decompressedBytes, LzwBytes); popup.Owner = this; popup.ShowDialog(); if (popup.chooseCompress == 1) { fileHandler.SaveFile(RleContainer); } else if (popup.chooseCompress == 2) { fileHandler.SaveFile(LzwContainer); } else { fileHandler.SaveFile(decompressedContainer); } } }