Home › Forums › TWAIN Classic › Duplex scanning and automatic scanning problem
- This topic has 3 replies, 4 voices, and was last updated 10 years, 4 months ago by ericward.
- AuthorPosts
I make the data source (DS), in the DS above I made the following functions:
Automatic scanning, in the endXfer function to increase to judge whether a paper to judge, if there is paper, calls began scanning function, so, as I think the automatic scanning function;
Duplex scanning, also in the endXfer function, but the difference is to determine whether ICAP_DUPLEXENABLE is true here, and by judging whether has sent a positive image, if m_Xfers.Count = 1, then the current state to the dsState_XferReady, which can realize the duplex scanning.
But the problem is feeling two image released a very similar, I want to ask next, automatic scanning and duplex scanning is achieved? Hope master pointing!!! Thank you.
我是做数据源(DS)的,在DS上面我做了以下功能:
自动扫描,在endXfer函数里增加判断是否有纸的判断,如果有纸,就调用开始扫描函数,这样,成为了我认为的自动扫描的功能;
双面扫描,同样在endXfer函数里,但不同的是在这里判断ICAP_DUPLEXENABLE是否为true,且通过判断是否已经发送了正面图像,如果是则m_Xfers.Count = 1,然后当前状态变为dsState_XferReady,这样就可以实现双面扫描。
但问题是感觉两种放出出的图像十分相似,我想问下,自动扫描与双面扫描是这样实现吗?希望能得到高手的指点!!!谢谢…another translation:
I’m responsible for Data Source(DS). Here’s the functions I’m trying to make:Automatic Scan. in endXfer function, add judgment sentences to judge if there’s paper (in ADF). If yes, then call scan function. That’s what I think of the Automatic Scanning feature.
Duplex Scan. add judgment sentences in endXfer function as well, but judge if ICAP_DUPLEXENABLE is TRUE and the image of front side has been sent. If yes, then m_Xfers.Count = 1 and the current status is changed to dsState_XferReady. That’s how the duplex scanning is implemented.
Are above the right way to implement Automatic Scanning and Duplex Scan? Thanks.
Hi pamxy
I would add this:
Have your own integer variable imageCount: how many more images application wants.
When you start scan, set imageCount = value of CAP_XFERCOUNT. This will be -1 which means ‘as many as possible’, or N > 0 which means ‘application only want N images’.When you complete an image transfer, if imageCount > 0, do –imageCount.
Before other tests in the endXfer function, check if imageCount == 0.
If imageCount ==0, then set State = 5, set m_Xfers.Count = 0, turn off motor 😉 and return.Automatic Scan. in endXfer function, add judgment sentences to judge if there’s paper (in ADF). If yes, then call scan function. That’s what I think of the Automatic Scanning feature.
Sounds OK to me. Comes after duplex check. Set m_Xfers.Count = -1, set State = 6, return.
Duplex Scan. add judgment sentences in endXfer function as well, but judge if ICAP_DUPLEXENABLE is TRUE and the image of front side has been sent. If yes, then m_Xfers.Count = 1 and the current status is changed to dsState_XferReady. That’s how the duplex scanning is implemented.
I would say, m_Xfers.Count = -1, which means “some more images, I don’t know how many”.
Unless you can count the pages in the ADF, it is normal to use -1 for this.Not very familar with the duplex scanning. But I find an old post for you, hope it will help you finish your twain scanning project.
- AuthorPosts