I am developing a c# windows form application.. I want to merge two picturebox and save it to custom file location.. I used following code to do it. But it only save 2nd picturebox image. Could anybody tell me how to merge this two picturebox and save it..
{
// open file dialog
OpenFileDialog open = new OpenFileDialog();
// image filters
open.Filter = "Image Files(*.jpg; *.jpeg; *.gif;*.png; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp;*.png";
if (open.ShowDialog() == DialogResult.OK)
{
// display image in picture box
pictureBox2.Image = new Bitmap(open.FileName);
//combine two images
// image file path
textBox1.Text = open.FileName;
}
}
private void button2_Click(object sender, EventArgs e)
{
SaveFileDialog dialog = new SaveFileDialog();
dialog.Filter = "JPG(*.JPG)|*.jpg";
if (dialog.ShowDialog() == DialogResult.OK)
{
previewimg.Image.Save(dialog.FileName);
pictureBox2.Image.Save(dialog.FileName);
}
}
}