How to close the Select Source dialog box when I click the Cancel button?

[Deprecated]

Symptom:

In the Select Source dialog box (see the image below), when I click the Cancel button, the User Interface (UI) of the source is displayed unexpectedly, or the scanning process gets started, just like it does when I click the Select button.


Resolution:

In your scan page, please call the AcquireImage method and other properties/methods of Dynamic Web TWAIN when the SelectSource method returns true. Here is a simple sample for you:

JavaScript Code:

function btnScan_onclick() 
{
      if (frmScan.DynamicWebTwain1.SelectSource())
      {
            frmScan.DynamicWebTwain1.OpenSource();                
            frmScan.DynamicWebTwain1.MaxImagesInBuffer = 4;
            frmScan.DynamicWebTwain1.IfShowUI = true;    
            frmScan.DynamicWebTwain1.IfDisableSourceAfterAcquire = true;
                                    
            frmScan.DynamicWebTwain1.AcquireImage();
       }
}

Reference:

SelectSource