将图像从vb.net的列表视图保存到文件夹中的问题


Dim path As String = "c:Mahesh" & TextBox1.Text
If Not Directory.Exists(path) Then
Directory.CreateDirectory(path)
'    Dim i As Integer
For i = 0 To ImageList1.Images.Count - 1
FileCopy(ImageList1.Image.FromFile(path))
ImageList1.Images.Add(Image.FromFile(path))
Next
Else
MsgBox("خطأ")
End If

您可以使用image.save方法保存每个图像对象。在这种情况下,您必须编写类似的内容:

Private sub SavePNGFromImageList1(imgIndex as integer, path as String)
ImageList1.Images(imgIndex).Save(path, System.Drawing.Imaging.ImageFormat.Png)
End sub

您可以使用不同的图像格式(请参阅ImageFormat类(

最新更新