I\'m hoping someone has come across this - I\'m trying to capture images from a document scanner using WIA, however on random machines when attempting to transfer the image resu
Solved.
It turns out that WIA actually stores captured images as temporary files in the Users profile temp folder, so:
Path.GetTempPath()
or C:\Users\USER_PROFILE\AppData\Local\Temp\
Files are stored in the format imgXXXX.tmp
In our case - the reason this caused an issue, which doesn't seem to be documented anywhere on the net, is that we polled the scanner every few seconds - creating a temp file, as there are only 4x's, there can be a max of 65K temp files before WIA will bug out.
Setting up a routine to clear out old image files from this temp folder immediately resolved the issue.
I came across this same problem when trying to use WIA to read images off of a camera device. The proper solution is to dispose of the WIA.ImageFile properly. This cleans up the tmp file.
Marshal.ReleaseComObject(Image1);
I found this on CodePrjoct, link