i use foreach to read all the image from a folder
string[] filePaths = Directory.GetFiles(Workspace.InputFolder, "*.*");
foreach (string imageFile in filePaths)
{
// Some Process here, the output are correct, just after output
the error happen
}
But it come out error
System.OutOfMemoryException was unhandled
Message=Out of memory.
Source=System.Drawing
Is the problem cause by the foreach loop keep looping after the process finish? What should i do for releasing the memory? Thanks.