This project has moved and is read-only. For the latest updates, please go here.

Cancel scanning

During the processing of events from a Twain32 class, you can cancel the subsequent scan.

private void _twain32_EndXfer(object sender,Twain32.EndXferEventArgs e) {
    try {
        // ...
        e.Cancel = true; // <<< it tell scanner that does not need to scan more.
        // ...
    } catch(Exception ex) {
        // ...
    }
}

private void _twain32_XferDone(object sender,Twain32.XferDoneEventArgs e) {
    try {
        // ...
        e.Cancel = true; // <<< it tell scanner that does not need to scan more.
        // ...
    } catch(Exception ex) {
        // ...
    }
}

private void _twain32_SetupMemXferEvent(object sender,Twain32.SetupMemXferEventArgs e) {
    try {
        // ...
        e.Cancel = true; // <<< it tell scanner that does not need to scan more.
        // ...
    } catch(Exception ex) {
        // ...
    }
}

private void _twain32_MemXferEvent(object sender,Twain32.MemXferEventArgs e) {
    try {
        // ...
        e.Cancel = true; // <<< it tell scanner that does not need to scan more.
        // ...
    } catch(Exception ex) {
        // ...
    }
}

private void _twain32_SetupFileXferEvent(object sender,Twain32.SetupFileXferEventArgs e) {
    try {
        // ...
        e.Cancel = true; // <<< it tell scanner that does not need to scan more.
        // ...
    } catch(Exception ex) {
        // ...
    }
}

private void _twain32_FileXferEvent(object sender,Twain32.FileXferEventArgs e) {
    try {
        // ...
        e.Cancel = true; // <<< it tell scanner that does not need to scan more.
        // ...
    } catch(Exception ex) {
        // ...
    }
}

Last edited Dec 9, 2016 at 3:42 PM by SARAFF, version 1