![](/img/trans.png)
[英]Can i retrieve images and shapes from word file and display them in PictureBox control of C#?
[英]Can't display images in picturebox in data repeater control in C#
我无法在数据转发器控件的图片框中显示图像。 我的代码是:
cnn.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new System.Data.DataSet();
da.Fill(ds);
bi.DataSource = ds.Tables[0];
textBox1.DataBindings.Add("Text",bi,"Emri");
textBox2.DataBindings.Add("Text", bi, "Mbiemri");
Byte[] bfoto = (Byte[])(ds.Tables[0].Rows[0]["Foto"]);
MemoryStream ms = new MemoryStream(bfoto);
Bitmap bFoto = new Bitmap(ms);
pictureBox1.DataBindings.Add("image", bi, "Foto", true);
dataRepeater1.DataSource = bi;
这是一个如何从位图设置图像属性的示例。
PictureBox pictureBox1 = new PictureBox();
// your code
Bitmap bFoto = new Bitmap(ms);
pictureBox1.Image = bFoto;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.