This project has moved. For the latest updates, please go here.

How to save scanned images to my computer

Nov 5, 2016 at 6:50 AM
I will be using feeder type scanner where i take multiple scanning continuously, i want my images to be stored to the specified directories as soon as the image is being scanned in normal .tif format. Please help me with a solution. I am working with visual studio 2013 winforms with c# code. Thanks in advance.
Coordinator
Nov 5, 2016 at 10:17 AM
Hello, ArunEZY.
See the Saraff.Twain.Sample2.
Nov 5, 2016 at 11:18 AM
Yeah, i tried with it but the problem was it saved the image with no file extension and is not viewed in thumbnail format, i need a solution to this. Another problem am dealing with is , am using a feeder type scanner for multiple scans and there am unable to view each and every scanned doc in my picturebox where i am able to view only the image of the last scanned document.Here i need to view every scanned image in picturebox as soon as they are scanned like flashing.
Coordinator
Nov 5, 2016 at 6:59 PM
Hello, ArunEZY.
/// <summary>
/// Occurs at the end of every transfer when the application has received all the data it expected.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void _twain32_EndXfer(object sender,Twain32.EndXferEventArgs e) {
    try {
        using(var _image = e.Image) {
            _image.Save("filename.tif",ImageFormat.Tiff);
        }
    } catch(Exception ex) {
        // ...
    }
}
or
/// <summary>
/// Occurs at the end of every transfer when the application has received all the data it expected.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void _twain32_EndXfer(object sender,Twain32.EndXferEventArgs e) {
    try {
        (this.CurrentImage=e.Image).Save("filename.tif",ImageFormat.Tiff);
    } catch(Exception ex) {
        // ...
    }
}
Marked as answer by ArunEZY on 11/7/2016 at 1:09 AM
Nov 7, 2016 at 6:56 AM
Thank you so much Mr.Saraff. Now every images are being displayed in the picbox and are also being saved but the image format is still unkown, images are not in view when displayed in thumbnail view. i.e., the output image from the application is just as a file with no extension.Please help me with a solution.
Coordinator
Nov 7, 2016 at 8:56 AM
Hello, ArunEZY.
You yourself must specify the desired extension for the file.
_image.Save("filename.TIF",ImageFormat.Tiff);
or
_image.Save("filename.JPG",ImageFormat.Jpeg);
or
_image.Save("filename.BMP",ImageFormat.Bmp);
Marked as answer by ArunEZY on 11/7/2016 at 1:09 AM
Nov 7, 2016 at 9:08 AM
Hello Saraff,
Got my problems fixed by specifying the extensions in coding as you have mentioned above, sorry i dint notice that point in your reply clearly. Many many thanks for your response and a special thanks for supporting and helping developers, great work by you keep going further.