Skip to content

Instantly share code, notes, and snippets.

@yushulx
Created August 20, 2020 03:16
Show Gist options
  • Select an option

  • Save yushulx/1c3a3c43e1c16dd672574a4f6f96b0e6 to your computer and use it in GitHub Desktop.

Select an option

Save yushulx/1c3a3c43e1c16dd672574a4f6f96b0e6 to your computer and use it in GitHub Desktop.
function acquireImage() {
if (DWServiceObject) {
var onSuccess, onFailure;
onSuccess = onFailure = function () {
DWServiceObject.CloseSource();
};
var deviceConfiguration = {
SelectSourceByIndex: 0,
IfShowUI: false,
PixelType:Dynamsoft.EnumDWT_PixelType.TWPT_RGB,
Resolution: 300,
IfFeederEnabled: false,
IfDuplexEnabled: false,
IfDisableSourceAfterAcquire: true,
};
DWServiceObject.SelectSourceByIndex(document.getElementById('source').selectedIndex);
DWServiceObject.AcquireImage(deviceConfiguration, onSuccess, onFailure);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment