We are developing in Visual Studio 2005 using C#.
We have an older version (2.0) of DotTwain.
My question arises from a sentence I saw in the help Docs for the AcquireEventArgs class. In the "Remarks" section, it states: "It is the responsibility of the application to dispose of the image provided in the ImageAcquired event." Because of that, I disposed of the image when done:
private void acquisition_ImageAcquired(object sender, AcquireEventArgs e)
{
// Do acquire stuff...
e.Image.Dispose();
}
This has caused problems, where in one of my applications I get an exception thrown from the driver that an object has no instance. In another of my applications, it seems to work OK. I'm trying to figure out if that Dispose() call should be in my code or not.
Should I be trying to dispose of the image at the end of the ImageAcquired event? If not, what does that "Remarks" comment indicate I should be doing?
Thanks!
-Scott Burrington