Image file batch processing (Out of memory error)

swu

Active member
Joined
Mar 26, 2005
Messages
33
Programming Experience
1-3
Does anyone have a sample code for batch processing image files.

I have some rough code put together but I keep getting an out of memory error.

Can anyone recommend an effecient way to do this?

Thanks in advance.
 
VB.NET:
    Private Sub GetFiles(ByVal SourceDir As IO.DirectoryInfo)
        Try
            For Each file As String In IO.Directory.GetFiles(SourceDir.ToString())
                ProcessFile(file)
            Next
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error found", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

I would create a method to handle the processing of 1 file and call it multiple times from a loop.

Something like this would let you call a method (ProcessFile) for each file in a directory and pass it the path to the file you're going to process.
 
Back
Top