Converting a bitmap to a byte array
This just asks the .Save() method to save the bytes to a memory stream, then you can get the written bytes to the stream:

// Bitmap bytes have to be created via a direct memory copy of the bitmap
private byte[] BmpToBytes_MemStream(Bitmap bmp)
{
MemoryStream ms = new MemoryStream();
// Save to memory using the Jpeg format
bmp.Save(ms, ImageFormat.Jpeg);
// read to end
byte[] bmpBytes = ms.GetBuffer();
bmp.Dispose();
ms.Close();
return bmpBytes;
}
private byte[] BmpToBytes_MemStream(Bitmap bmp)
{
MemoryStream ms = new MemoryStream();
// Save to memory using the Jpeg format
bmp.Save(ms, ImageFormat.Jpeg);
// read to end
byte[] bmpBytes = ms.GetBuffer();
bmp.Dispose();
ms.Close();
return bmpBytes;
}
converting that back to a bitmap is easy.

//Bitmap bytes have to be created using Image.Save()
private Image BytesToImg (byte[] bmpBytes)
{
MemoryStream ms = new MemoryStream(bmpBytes);
Image img = Image.FromStream(ms);
// Do NOT close the stream!
return img;
}
private Image BytesToImg (byte[] bmpBytes)
{
MemoryStream ms = new MemoryStream(bmpBytes);
Image img = Image.FromStream(ms);
// Do NOT close the stream!
return img;
}
from:http://www.vbforums.com/showthread.php?t=358917