我有一個表格學生,有一個以二進制形式存儲圖片的照片字段。
我想用我所有的學生照片來填充我的組合框,就像我們用所有學生的名字填充組合框一樣。如何用圖片填充imagecombobox(Devexpreess Controls)
private void populateData()
{
studentList=(from s in _ApplicationDB.Students select s).ToList();
foreach (Student _record in studentList)//.OrderBy(i => i)
{
comboBoxEdit1.Properties.Items.Add(_record.Name);
imageComboBoxEdit1.Properties.SmallImages(_record.Photo);//error in this line
}
}
你能告訴我們你嘗試過什麼? – Max
你需要告訴我們你試過的東西。另外,當有人試圖幫助你時,不要求任何東西。它不會讓你到達任何地方。 – gleng
嗨@MaxMommersteeg我已經做到現在。 我使用此表格代碼保存圖片 string path1 = textEditFilePath.Text; FileStream fs = new FileStream(path1,FileMode.Open,FileAccess.Read); byte [] picbytes = new byte [fs.Length]; fs.Read(picbytes,0,(int)fs.Length); record.Photo = picbytes; – waleed