Click here to Skip to main content
14,392,668 members
   

C#

 
GeneralRe: How to scan all pages with one click as below: Pin
Richard MacCutchan19-Nov-19 4:40
mveRichard MacCutchan19-Nov-19 4:40 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 4:52
MemberMember 1094325619-Nov-19 4:52 
GeneralRe: How to scan all pages with one click as below: Pin
Richard MacCutchan19-Nov-19 5:02
mveRichard MacCutchan19-Nov-19 5:02 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 5:08
MemberMember 1094325619-Nov-19 5:08 
GeneralRe: How to scan all pages with one click as below: Pin
Richard MacCutchan19-Nov-19 5:13
mveRichard MacCutchan19-Nov-19 5:13 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 5:30
MemberMember 1094325619-Nov-19 5:30 
GeneralRe: How to scan all pages with one click as below: Pin
Richard MacCutchan19-Nov-19 5:45
mveRichard MacCutchan19-Nov-19 5:45 
AnswerRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon19-Nov-19 3:02
communityengineerPete O'Hanlon19-Nov-19 3:02 
According to the Windows Imaging Acquisition codes, that means the paper is empty. If you reach this point, it suggests that you have finished scanning. Something you need to consider; your while loop will never end until you hit an exception because you aren't setting it to false anywhere. Also, your logic looks very odd. You're evaluating the scanners each time through the while loop, and connecting again and again. You should move the for loop and the AvailableScanner.Connect outside the while loop; something like this perhaps:
for (int i = 1; i <= deviceManager.DeviceInfos.Count; i++)
{
  if (deviceManager.DeviceInfos[i].Type != WiaDeviceType.ScannerDeviceType) // Skip device If it is not a scanner
  {
    continue;
  }
  AvailableScanner = deviceManager.DeviceInfos[i];
  break;
}
if (AvailableScanner == null)
{
  return;
}
var device = AvailableScanner.Connect();
while (continueRunning2)
{
  // Are you absolutely certain you want array index 1 here?
  // Remember that arrays start at 0, so this might be a cause of
  // issues
  var ScanerItem = device.Items[1];
  ...
}



modified 19-Nov-19 8:08am.

GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 3:23
MemberMember 1094325619-Nov-19 3:23 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon19-Nov-19 3:37
communityengineerPete O'Hanlon19-Nov-19 3:37 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon19-Nov-19 3:38
communityengineerPete O'Hanlon19-Nov-19 3:38 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 3:50
MemberMember 1094325619-Nov-19 3:50 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon19-Nov-19 23:40
communityengineerPete O'Hanlon19-Nov-19 23:40 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325620-Nov-19 1:35
MemberMember 1094325620-Nov-19 1:35 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon20-Nov-19 1:49
communityengineerPete O'Hanlon20-Nov-19 1:49 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325620-Nov-19 5:17
MemberMember 1094325620-Nov-19 5:17 
GeneralRe: How to scan all pages with one click as below: Pin
Pete O'Hanlon20-Nov-19 6:15
communityengineerPete O'Hanlon20-Nov-19 6:15 
GeneralRe: How to scan all pages with one click as below: Pin
Member 1094325619-Nov-19 4:04
MemberMember 1094325619-Nov-19 4:04 
QuestionInsert voice data down SQLServer Pin
Hoang Luc18-Nov-19 5:45
MemberHoang Luc18-Nov-19 5:45 
AnswerRe: Insert voice data down SQLServer Pin
OriginalGriff18-Nov-19 5:46
mveOriginalGriff18-Nov-19 5:46 
Questionadd code text to speech voices windows 7 ? Pin
Member 245846717-Nov-19 22:14
MemberMember 245846717-Nov-19 22:14 
AnswerRe: add code text to speech voices windows 7 ? Pin
Pete O'Hanlon17-Nov-19 23:07
communityengineerPete O'Hanlon17-Nov-19 23:07 
GeneralRe: add code text to speech voices windows 7 ? Pin
Member 245846720-Nov-19 16:45
MemberMember 245846720-Nov-19 16:45 
GeneralRe: add code text to speech voices windows 7 ? Pin
Pete O'Hanlon20-Nov-19 22:47
communityengineerPete O'Hanlon20-Nov-19 22:47 
GeneralRe: add code text to speech voices windows 7 ? Pin
Member 245846724-Nov-19 16:06
MemberMember 245846724-Nov-19 16:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.