Saving A Scanned Image

Example requests & Code samples for GdPicture Toolkits.
Post Reply
reynoldsjr
Posts: 1
Joined: Fri May 27, 2016 5:19 pm

Saving A Scanned Image

Post by reynoldsjr » Fri May 27, 2016 6:08 pm

Hello
I am new to GdPicture.NET and I am having difficulty saving an image after it has been scanned. The following is the code I am using to get the image to save to my C:

int ImageID;
int TiffID;
oGdPictureImaging.TwainOpenDefaultSource(this.Handle);
oGdPictureImaging.TwainSetHideUI(true); //Asks to the device to hide his GUI
oGdPictureImaging.TwainEnableDuplex(false);
ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(this.Handle);
TiffID = oGdPictureImaging.TiffCreateMultiPageFromGdPictureImage(ImageID);
GdViewer1.DisplayFromGdPictureImage(ImageID);
System.Windows.Forms.Application.DoEvents();
oGdPictureImaging.TiffSaveAsMultiPageFile(TiffID, "C:\test.tif", TiffCompression.TiffCompressionAUTO);
oGdPictureImaging.ReleaseGdPictureImage(ImageID);

David
Posts: 66
Joined: Mon Feb 08, 2016 3:12 pm

Re: Saving A Scanned Image

Post by David » Wed Jun 01, 2016 8:32 am

Hi Reynold,

Thank you for your interest in GdPicture.NET.

I believe you should have a look at the "Creating a multipage TIFF file from a document in the scanner using the TWAIN protocol" documentation, it is available here:
https://www.gdpicture.com/guides/gdpicture/web ... tocol.html

Now this code is just a tutorial, the return code should obviously be verified.

Having a look at the code you have shared with us I believe there are two things to be done:
- as it seems it does not work, you should check the return code so you could tell us what is the faulty call and what is the result
- under many circumstances the operating systems forbids to create "c:\test.tif", you should have a try with a different location

I'm looking forward to hearing from you.

Regards,

David

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest