View on GitHub

SARAFF SOFTWARE

All products / Saraff.Twain.NET / Contents

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) {
        // ...
    }
}