/*功能描述:把image类型的数据转为byte[],
* 参数:Image类型数据
* 返回值:byte[]类型数据
* */
public byte[] imageToByte(Image image)
{
System.IO.MemoryStream Ms = new MemoryStream();
image.Save(Ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] byte_img = new byte[Ms.Length];
Ms.Position = 0;
Ms.Read(byte_img, 0, Convert.ToInt32(Ms.Length));
Ms.Close();
return byte_img;
}