如果是这个需求的话我这里有一个思路,只需要设置一个IsCancel的变量就行,点击取消按钮后可以将IsCancel设置为True,那么在AcquirePage判断后就停止了
- bool IsCancel = false;
- private void _twain_AcquirePage(object sender, TwainAcquirePageEventArgs e)
- {
- if (IsCancel)
- {
- _twainSession.StopFeeder();
- return;
- }
- // This event occurs for each page acquired using the Acquire method
- try
- {
复制代码 |