> Hello
I finally managed to save Bitmap that reprezented my pictureBox to jpg
file, but now how can i load from that file to Bitmap again ?
Bitmap does not have any Load or Open method (like Save...).
Something like this, this prevents locking the file too long.
public void Load(string asFile) {
//--- Because Image keeps th file locked untill the garbage collector
releases it, we have
// to make it released as soon a possible using this trick.
Stream BitmapStream =
System.IO.File.Open(asFile,System.IO.FileMode.Open );
Image imgPhoto = Image.FromStream(BitmapStream);
BitmapStream.Close();
//--- Now the file is beeing released continue using the contents.
mBitmap=new Bitmap(imgPhoto);
}