Closed LuisJuarez closed 5 years ago
Hello, @LuisJuarez You can use a IStreamProvider. See https://github.com/saraff-9EB1047A4BEB4cef8506B29BA325BD5A/Saraff.Twain.NET/issues/29#issuecomment-431940887
Hi again, im using IStreamProvider now but the problem is the same. twian32 instance still storing all the images that it scan, and the exception still showing.
If you disposing acquired image, memory will be release (even if store reference to image). But I see that you using a MemoryStream for caching a image data. If you wanna acquiring a large number of images you must caching data of acquired image outside the RAM. See a IStreamProvider
thank you, now i can acquire large number of images :)
HI, im using Saraff twain, it works well with 20, 30 or 40 pages, but when i put 27 sheets (54 pages) an System.OutOfMemory exception is thrown, when i debbug the instance of _twain32 have 54 pages on the buffer, how can i clean the buffer?. I saw i this question a possible solution, and i put on mi code "using" to auto dispose the images, but the problem still.
Im using the EndXfer evento to save the Images on the disk can you tell me if i'm wrong?
private void _twain32_EndXfer(object sender, Twain32.EndXferEventArgs e) { using (var _image = e.Image) { _image.Save(pathImage + "\\" + imC.ToString() + ".jpeg", System.Drawing.Imaging.ImageFormat.Jpeg); } imC++; //e.Image.Dispose(); }
Thank you