Hi,
I have made a small application to monitor a directory. When I a new BMP file is added to that directory, my program converts it into a jpg file.
I have achieved this by using the FileSystemWatcher class.
Unfortunetely I recieved an 'Out Of Memory' error when a new bitmap file has been added to a folder.
The problem code is below
VB Code:
Private Sub FileSystemWatcher1_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created ListBox1.Items.Add(e.FullPath) Dim img As Image img = Image.FromFile(e.FullPath) 'blah blah blah, do something img.Dispose() End Sub
I recieve the error on this line
VB Code:
img = Image.FromFile(e.FullPath)
It never happens the first time this sub is called, its always on the second or greater.
Im out of ideas on what it could be, your help is much appreciated
Thanks




Reply With Quote