How to read list of images from a folder?
First Read all the image paths into a list, Let’s call it as List A, List A is List Of Strings.
Then Create a List of Images List B, List<System.Drawing.Image>
- Then Run foreach for List A
- Inside for each use Load Image Activity.
- Let us take each value as item in List A.
- Then Pass item in the field of path of Load Image Activity.
- Then create a image type variable imgC
- pass imgC in output Field.
- Now use Add to collections Activity and Add imgC to ListB
Now the List B will Contain Images
I have not tested this, But I think it will work.
Regards,
Mahesh
Im getting errors while trying the same. Can you please share the xaml file?
Hi,
Path-> string you folder location
string[] filePaths = Directory.GetFiles(path,"*.jpg")
2 Likes
What errors you are getting
Hi, can you share XAML file.
Hi,
Try this XAML file. Hope it works.
Read images from folder.xaml (6.7 KB)
Ok, I will try it!
Any idea on getting String, I am getting error…value of 1-d array of string cannot be converted to string
Use (.ToString). It’ll solve your problem.