نمایش عکس داخل pictureBox از Datagrid
سلام
چگونه می توانم یک عکس داخل pictureBox از روی ستونهای یک دیتاگرید ست کنم
( عکس را بصورت varbinary(MAX) ذخیره می کنیم )
نقل قول: نمایش عکس داخل pictureBox از ِDatagrid
byte[] arrPic = (byte[])(dataGridView1.CurrentRow.Cells[i].Value);
MemoryStream ms = new MemoryStream(arrPic);
pictureBox1.Image = Image.FromStream(ms);
ms.Close();
نقل قول: نمایش عکس داخل pictureBox از ِDatagrid
نقل قول:
نوشته شده توسط
abdullah20
byte[] arrPic = (byte[])(dataGridView1.CurrentRow.Cells[i].Value);
MemoryStream ms = new MemoryStream(arrPic);
pictureBox1.Image = Image.FromStream(ms);
ms.Close();
باسلام
این کدرا امتحان کرده بودم
ارور زیر را می دهد
Unable to cast object of type 'System.Data.Linq.Binary' to type 'System.Byte[]'.
نقل قول: نمایش عکس داخل pictureBox از Datagrid
سلام تبدیل به آرایه کن ببین مشکل حل میشه
byte[] arrPic = (dataGridView1.CurrentRow.Cells[i].Value).ToArray();
نقل قول: نمایش عکس داخل pictureBox از Datagrid
سلام
شبیه این کد :
this.pictureBox1.Image = (Image)this.dataGridView2[this.MyImageCol.Name, this.dataGridView2.CurrentCell.RowIndex].Value;
نقل قول: نمایش عکس داخل pictureBox از Datagrid
نقل قول:
نوشته شده توسط
ASKaffash
سلام
شبیه این کد :
this.pictureBox1.Image = (Image)this.dataGridView2[this.MyImageCol.Name, this.dataGridView2.CurrentCell.RowIndex].Value;
سلام
استاد
this.MyImageCol.Name,
نفهمیدم میشه بیشتر توضیح بدهید