我有这个列表视图和一个按钮。列表视图中还有几个图像。当按下按钮时,我想从文件夹内的列表视图中保存图像。而且我不知道该怎么做。你能帮帮我吗?谢谢。这是我用来将图像插入列表视图的代码。
OpenFileDialog opend1 = new OpenFileDialog();
opend1.Filter = "Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.*";
opend1.Multiselect = true;
if (opend1.ShowDialog() == DialogResult.OK)
{
listView1.View = View.LargeIcon;
imageList.ImageSize = new Size(100, 100);
for (int c = 0; c < opend1.FileNames.Length; c++)
{
Image i = Image.FromFile(opend1.FileNames[c].ToString());
Image img = i.GetThumbnailImage(100, 100, null, new IntPtr());
imageList.Images.Add(img);
}
listView1.LargeImageList = imageList;
ListViewItem lstItem = new ListViewItem();
lstItem.ImageIndex = imageList.Images.Count-1;
listView1.Items.Add(lstItem);
listView1.Refresh();
}