C# 如何在列表视图中显示图像?
我的知识存储在sql server中,例如列表视图中的数据示例如下所示,我写道:C# 如何在列表视图中显示图像?,c#,C#,我的知识存储在sql server中,例如列表视图中的数据示例如下所示,我写道: item.SubItems.Add(dr["Fname"].ToString ()); 当我在字段列表中时,单击文本框时,我编写的一条语句显示为Vaio示例: Vfname.Text = e.Item.SubItems[1].Text; 现在还不清楚您想做什么,但我认为您应该使用System.Drawing.Image.FromFile()将图像对象添加到列表视图中,然后调用Graphics.DrawImage
item.SubItems.Add(dr["Fname"].ToString ());
当我在字段列表中时,单击文本框时,我编写的一条语句显示为Vaio示例:
Vfname.Text = e.Item.SubItems[1].Text;
现在还不清楚您想做什么,但我认为您应该使用System.Drawing.Image.FromFile()将图像对象添加到列表视图中,然后调用Graphics.DrawImage将它们绘制出来,并传递列表视图中的图像文件
请提供更多信息,说明您迄今为止所做的尝试以及您希望实现的目标-从您的描述中,我真的无法理解您做了什么和什么不起作用,这非常令人困惑。
Image newImage = Image.FromFile("SampImag.jpg");
// Create Point for upper-left corner of image.
Point ulCorner = new Point(100, 100);
// Draw image to screen.
e.Graphics.DrawImage(newImage, ulCorner);