Hi,
I’m stuck trying to save pictures in a folder.
It only saves the last picture in the folder, replacing de previous ones.
for each plaatje As Picture in self.plaatjes
Dim fid As FolderItem = GetFolderItem("/Users/natasja/Desktop/plaatjes", FolderItem.PathTypeShell)
if not fid.Exists then
fid.CreateAsFolder
end if
Dim fif As FolderItem = fid.Child("plaatje.jpg")
plaatje.Save(fif,plaatje.SaveAsJPEG, plaatje.QualityMax)
Next
Dim fif As FolderItem = fid.Child("plaatje.jpg")
plaatje.Save(fif,plaatje.SaveAsJPEG, plaatje.QualityMax)
These two lines save every one of the pictures as the same file name - plaatje.jpg
you need to create different file names in your loop
dim counter as integer = 1
for each plaatje As Picture in self.plaatjes
Dim fid As FolderItem = GetFolderItem("/Users/natasja/Desktop/plaatjes", FolderItem.PathTypeShell)
if not fid.Exists then
fid.CreateAsFolder
end if
Dim fif As FolderItem = fid.Child("plaatje" + str(counter) + ".jpg")
plaatje.Save(fif,plaatje.SaveAsJPEG, plaatje.QualityMax)
counter = counter + 1
Next