I scan many(>50) big images 300dpi, 25bit.
There is my .net code.
Code: Select all
public bool s[b]omefunction()[/b]
{
GdPictureImaging oGdPictureImaging = new GdPictureImaging();
oGdPictureImaging.SetLicenseNumber("XXXX");
bool Res = true;
oGdPictureImaging.TwainSetHideUI(false);
try
{
int ImageID = 0;
int NewTiffID = 0;
int Counter = 0;
bool NeChetPageBlank = false;
bool ChetPageBlank = false;
if (oGdPictureImaging.TwainOpenDefaultSource(this.Handle))
{
do
{
ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(this.Handle);
if (ImageID != 0)
{
Counter++;
if ((Counter == 1))
{
NewTiffID = oGdPictureImaging.TiffCreateMultiPageFromGdPictureImage(ImageID);
oGdPictureImaging.ReleaseGdPictureImage(ImageID);
}
else
{
oGdPictureImaging.TiffAppendPageFromGdPictureImage(NewTiffID, ImageID);
oGdPictureImaging.ReleaseGdPictureImage(ImageID);
}
}
} while (System.Convert.ToInt16(oGdPictureImaging.TwainGetState()) >
System.Convert.ToInt16(TwainStatus.TWAIN_SOURCE_ENABLED));
if (NewTiffID != 0)
{
string NewFileName = Path.Combine(Application.StartupPath,"Test.tiff");
oGdPictureImaging.ReleaseGdPictureImage(NewTiffID);
NewTiffID = 0;
}
oGdPictureImaging.TwainCloseSource();
oGdPictureImaging.TwainUnloadSourceManager(this.Handle);
oGdPictureImaging.TwainCloseSourceManager(this.Handle);
}
}
catch (Exception e)
{
}
return Res;
}