将PICTUREBOX中显示的图片,存入数据库中
将PICTUREBOX中显示的图片(不知道图片路径),存入数据库中:
----------------------------------------------------------
----------------------------------------------------------
1
if (null != picBox.Image)
2
{
3
using(System.IO.MemoryStream ms = new System.IO.MemoryStream())
4
{
5
picBox.Image.Save(ms, picBox.Image.RawFormat);
6
Byte[] bt = new Byte[ms.Length];
7
ms.Read(bt, 0, ms.Length);
8
//将bt作为参数,传入 DBCOMMAND即可
9
}
10
}
if (null != picBox.Image)2
{3
using(System.IO.MemoryStream ms = new System.IO.MemoryStream())4
{5
picBox.Image.Save(ms, picBox.Image.RawFormat);6
Byte[] bt = new Byte[ms.Length];7
ms.Read(bt, 0, ms.Length);8
//将bt作为参数,传入 DBCOMMAND即可9
} 10
} 作者: 三角猫
http://www.zu14.cn/
转载请保留此信息



浙公网安备 33010602011771号