Just tested your code, it worked, the code is fine. There must be a problem with the image file or path. This is my test:
private void Form1_Load(object sender, EventArgs e)
{
byte[] data = File.ReadAllBytes("c:\\t.jpg");
using (Stream originalBinaryDataStream = new MemoryStream(data))
{
// This works perfectly fine, if use this method (which i can't).
//image = new Bitmap("Chick.jpg");
// This throws an exception when it's deserialized.
// It doesn't like the memory stream reference?
originalBinaryDataStream.Seek(0, SeekOrigin.End);
pictureBox1.Image= new Bitmap(originalBinaryDataStream);
}
}
And I see the image in the PictureBox.
Ovidiu Pacurar
2008-11-26 12:37:59