简体   繁体   中英

Question in save image to folder from listview for 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

You can save every image object with the Image.Save method . In this case, you have to write something similar to this:

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

You can use different image formats (see ImageFormat class )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM