Home › Forums › TWAIN Classic › Duplex scanning both side
- This topic has 22 replies, 6 voices, and was last updated 11 years, 11 months ago by Isuru.
- AuthorPosts
no, what condition code – you’ll need the status triplet
I’ve changed DSixfer.
Before:
private static extern eTwRC DSixfer( [In, Out] cTwIdentity origin, [In] cTwIdentity dest, eTwDG dg, eTwDAT dat, eTwMSG msg, ref IntPtr hbitmap );After
private static extern eTwCC DSixfer( [In, Out] cTwIdentity origin, [In] cTwIdentity dest, eTwDG dg, eTwDAT dat, eTwMSG msg, ref IntPtr hbitmap );eTwRC -> eTwCC
And now first:
cc = DSixfer(m_appID, m_srcDS, eTwDG.Image, eTwDAT.ImageNativeXfer, eTwMSG.Get, ref hbitmap);cc = eTwCC.BadCap
Second:
cc = DSixfer(m_appID, m_srcDS, eTwDG.Image, eTwDAT.ImageNativeXfer, eTwMSG.Get, ref hbitmap2);cc = eTwRC.Bummer
I’m not sure if you pasted in the wrong DAT or if you’re not understanding how to get the status, but at some point you’ll need to send DAT_STATUS,..
.
Hello there,
Please help me in my current problem regarding duplex scanning.
I dont know how to set the CAP_Duplex and CAP_DuplexEnabled in my Code.
how to Add the 2 properties in TwCAP and what are the values?
Currently, my code contains like this in my TwCAP:Friend Enum TwCap As Short
XferCount = &H1
ICompression = &H100
IPixelType = &H101
IUnits = &H102
IXferMech = &H103
End Enumplease help me how do i solve this.
and also this is my code in Acquire().Public Function Acquire() As Boolean
Dim rc As TwRC
CloseSrc()
If Equals(appid.Id, IntPtr.Zero) = True Then
Init(hwnd)
If Equals(appid.Id, IntPtr.Zero) = True Then
Return False
End If
End Ifrc = DSMident(appid, IntPtr.Zero, TwDG.Control, TwDAT.Identity, TwMSG.OpenDS, srcds)
If (rc <> TwRC.Success) Then
CloseSrc()
Return False
End IfDim cap As TwCapability = New TwCapability(TwCap.XferCount, -1)
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, cap)
If (rc <> TwRC.Success) Then
CloseSrc()
Return False
End IfDim guif As TwUserInterface = New TwUserInterface
guif.ShowUI = 1
guif.ModalUI = 1
guif.ParentHand = hwnd
rc = DSuserif(appid, srcds, TwDG.Control, TwDAT.UserInterface, TwMSG.EnableDS, guif)
If (rc <> TwRC.Success) Then
CloseSrc()
Return False
End If
Return True
End Functionplease help me how to do Scan Duplex.
Thanks…
Mabuhay!!!add code to check for the ConditionCode first, messing caps is only more difficult without the ConditionCode information.
what kind of device?
.
Thanks Gabe,
I am currenty using Fujitsu Scanner 5120C.
What do you mean by ConditionCode?Where should I put the ConditionCode?
Thanks and Mabuhay!!!
Read the twain spec, search for ‘condition code’. The condition code is similar to the return code except the condition code (if you’re lucky) tells you why. You’ll want the condition code when the return code is failure, it will tell you that a particular twain call failed because the device doesn’t support a particular capability or because the twState of the device isn’t quite right or etc…
Read the spec.Also, decisions based on rc aren’t a good idea; you’ll want to make decisions based on rc & cc, not rc alone.
.
I found a code to scan document in codeproject (http://www.codeproject.com/Articles/1376/NET-TWAIN-image-scanner)
but it does not support duplex scanning.
can anyone please help me to scan both sides using twain.
My scanner is Avision AV122 duplex scanning supported scanner.- AuthorPosts