2010-07-14 89 views
1

我有一个列表视图,我已经存储了图像,现在我的幻灯片显示我想要这个图像到图片框。但没有得到确切的方式来从列表视图中获取图像。我如何从listview中获取图像并将其分配给picturebox?

任何人都可以对此有所了解吗?

在此先感谢。

+1

能否请您从您的项目分享一些代码? – Myra 2010-07-14 08:58:48

回答

1

前段时间我有类似的问题。 这从微软ARTICAL是非常有益:http://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox.image%28VS.80%29.aspx

尤其是这部分

ListViewItem selection = ListView1.GetItemAt(e.X, e.Y); 

    // If the user selects an item in the ListView, display 
    // the image in the PictureBox. 
    if (selection != null) 
    { 
     PictureBox1.Image = System.Drawing.Image.FromFile(
      selection.SubItems[1].Text); 
    } 
+0

我不存储图像路径,它填充图像的数组的字节。 – Manish 2010-07-14 12:48:31

相关问题