Dear Friend,
First of all, here is the right way to load an image to a picture box,
// Specify a valid picture file path on your computer.
FileStream fs;
string strSourceImage;
fs = new FileStreamstrSourceImage, FileMode.Open, FileAccess.Read);
picbxImage.Image = System.Drawing.Image.FromStream(fs);
fs.Close();
And if you tried this:
picbxImage.Image = new BitMap(strSourceImage);
The site of microsoft reported this problem,
The picture box will make a lock on the file containing this image, and you will not be able to delete this
file (even if this image is not the selected image now).
So, now, after you modified your image, how can you save it again?
using the following:
string strDestImage;
pictureBox1.Image.Save(strDestImage);
You can try it and tell me if there are any thing missing
Hope this helps.
|