【发布时间】:2012-03-27 01:56:19
【问题描述】:
我刚刚将位图缩略图转换为二进制代码以存储到我的 MS Access 数据库中。我现在正在尝试将该二进制数据转换回图像格式以存储到我的 Imagelist 中。我现在的代码是。
private void Form1_Load(object sender, EventArgs e)
{
vcon.Open();
string get = "Select Path, Images FROM IMGSTR";
OleDbCommand cmdget = new OleDbCommand(get, vcon);
OleDbDataReader reader;
reader = cmdget.ExecuteReader();
while (reader.Read())
{
string path = reader["Path"].ToString();
// should I convert binary into a string?
string thumbnail = reader["Images"].ToString();
// How to convert the binary data from the
// MS database back to a bitmap image.
//I need to convert the binary back to bitmap to work
//in this imagelist.
this.imageList1.Images.Add(thumbnail);
}
}
如果有人可以帮助我,那就太好了。谢谢!
【问题讨论】:
标签: c# image ms-access bitmap binary