I'm having a problem with documents I scan having a grey background instead of white. When I scan the same document with the same scanner using other software the background is white. In both cases I am scanning greyscale. My version is 6.4001 (I'll update to the latest).
The code I'm using is below, thanks for any help you can procide.
Neal.
Code: Select all
//Here we will scan in a 8bit Grayscale 200DPIjpeg file
if (Imaging1.TwainOpenDefaultSource(this.Handle))
{
InitScanConfig();
if (chkDuplex.Checked)
{
Imaging1.TwainEnableDuplex(true);
}
else
{
Imaging1.TwainEnableDuplex(false);
}
if ((int)cmbDocType.SelectedValue == 25) // Higer Res for R2 Images
{
Imaging1.TwainSetResolution(300);
}
else
{
Imaging1.TwainSetResolution(200);
}
Imaging1.TwainSetPixelType(TwainPixelType.TWPT_GRAY);
Imaging1.TwainSetBitDepth(8);
Imaging1.TwainSetPaperSize(TwainPaperSize.USLETTER);
saved = false;
if (Imaging1.TwainHasFeeder())
{
Imaging1.TwainSetAutoFeed(true);
Imaging1.TwainSetAutoScan(true);
int twainstate = (int)Imaging1.TwainGetState();
while (twainstate == 6 || (twainstate > 3 && Imaging1.TwainIsFeederLoaded()))
{
ScanPage();
twainstate = (int)Imaging1.TwainGetState();
}
}
else
{
ScanPage();
}
if (Imaging1.TwainGetState() == TwainStatus.TWAIN_SOURCE_OPEN)
{
// Imaging1.TwainCloseSource();
}
txtPageCount.Text = currPage.ToString() + " of " + pageCount.ToString();
GdViewer1.SetZoomFitViewer();
loadPage();
this.Focus();
private void InitScanConfig()
{
Imaging1.TwainSetHideUI((chkHideUI.Checked));
Imaging1.TwainEnableDuplex(chkDuplex.Checked);
Imaging1.TwainSetAutoSize(true);
}