using System;
using System.Windows.Forms;
using System.Drawing;
using SteganographyLib;
namespace SteganografiaImg
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Bitmap bmp = null;
Steganography codice = new Steganography();
string extractedText = string.Empty;
private void hideButton_Click(object sender, EventArgs e)
{
bmp = (Bitmap)imagePictureBox.Image;
if (encryptCheckBox.Checked)
{
codice.criptaImg(bmp, dataTextBox.Text, true, passwordTextBox.Text);
}else{
codice.criptaImg(bmp, dataTextBox.Text);
}
}
private void extractButton_Click(object sender, EventArgs e)
{
bmp = (Bitmap)imagePictureBox.Image;
if (encryptCheckBox.Checked)
{
dataTextBox.Text = codice.decriptaIimg(bmp,true,passwordTextBox.Text);
}
else
{
dataTextBox.Text = codice.decriptaIimg(bmp);
}
}
private void Form1_Load(object sender, EventArgs e)
{
CaricaImmagine();
}
private void CaricaImmagine()
{
//Set the SizeMode to center the image.
imagePictureBox.SizeMode = PictureBoxSizeMode.StretchImage;
imagePictureBox.Image = codice.CaircaImaggine();
}
}
}