private void Hide_Click(object sender, EventArgs e) { // check if any file is selected if (string.IsNullOrEmpty(imgPath)) { MessageBox.Show("Error: No file is selected", "Alert"); return; } // prepossing the input and insert the message int insertLog = TextProcessing.InsertMsg(textBox1.Text, imgMap); if (insertLog == 0) { MessageBox.Show("Error: Not enough space for insertion", "Alert"); return; } else { // save the picture with hidden message string newPath = Directory.GetParent(imgPath).ToString() + '/' + Path.GetFileNameWithoutExtension(imgPath) + "_copy.png"; imgMap.Save(newPath, ImageFormat.Png); } // reinitialize the output text and deselect the image Reinitialize("", "Waiting for input...", "", null); }
private void Seek_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(imgPath)) { return; } // process the input and extract the message string plaintext = TextProcessing.ExtractMsg(textBox1.Text, imgMap); // now the user selects no image Reinitialize(plaintext, "Waiting for input...", "", null); }