Does anybody know how to solve the stated problem below:
- I used AxGdPicturePro4.AxImaging control to scan a document.
Using this function 'Imaging1.TwainShowSetupDialogSource(Me.Handle.ToInt32)' you can set the resolution and etc.
I set 200 but when I scan the document, it is still getting 150 resolution which is the default resolution.
So how to solve this problem? That it should get the resolution set in the Setup Dialog Source.
Kindly check the code below, I used in scanning a multipage document.
- Code: Select all
If Imaging1.TwainOpenDefaultSource() Then
InitScanConfig()
nImageCount = 0
Imaging1.TwainSetAutoFeed(True) 'Set AutoFeed Enabled
Imaging1.TwainSetAutoScan(True) 'To achieve the maximum scanning rate
'nRes = Imaging1.TwainGetCurrentResolution
If chk11.Checked = False Then
'Imaging1.TwainSetCurrentResolution(300)
'bFlag = Imaging1.TwainSetCurrentResolution(nRes)
bFlag = Imaging1.TwainSetCurrentPixelType(GdPicturePro4.TwainPixelType.TWPT_RGB) 'RGB
bFlag = Imaging1.TwainSetCurrentBitDepth(8) ' 24 bpp
Else
'Imaging1.TwainSetCurrentResolution(200)
'bFlag = Imaging1.TwainSetCurrentResolution(nRes)
bFlag = Imaging1.TwainSetCurrentPixelType(GdPicturePro4.TwainPixelType.TWPT_BW) 'BW
bFlag = Imaging1.TwainSetCurrentBitDepth(1) ' 1 bpp
End If
Imaging1.PdfNewPdf(m_sFilename)
While Imaging1.CreateImageFromTwain(Me.Handle.ToInt32) <> 0
nImageID = Imaging1.GetNativeImage
Call ApplyImageFilters(nImageID)
If chk10.CheckState = 1 Then Call DisplayNativeImage()
Me.Update()
nImageCount = nImageCount + 1
Call Imaging1.PdfAddImageFromImageID(nImageID)
Imaging1.CloseImage(nImageID)
If nPage = 0 Then
Else
If nImageCount >= nPage Then
Exit While
End If
End If
End While
For nCpt = 1 To nImageCount
Call Imaging1.PdfSetPageDimensions(Imaging1.PdfGetImageWidth(nCpt), Imaging1.PdfGetImageHeight(nCpt))
Imaging1.PdfNewPage()
Call Imaging1.PdfDrawImage(nCpt, 0, 0, Imaging1.PdfGetImageWidth(nCpt), Imaging1.PdfGetImageHeight(nCpt))
Imaging1.PdfEndPage()
Next nCpt
Imaging1.PdfSavePdf()
Call Imaging1.TwainCloseSource()
Thank you very much in advance.
Best Regards,
fernan
