Created
August 6, 2020 08:24
-
-
Save yushulx/475a7f7714e3d80184f824a4e47ecc25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handleClick() { | |
if (DWObject) { | |
let image = this.shadowRoot.querySelector('#image'); | |
DWObject.SelectSource(function () { | |
var onSuccess, onFailure; | |
onSuccess = onFailure = function () { | |
DWObject.CloseSource(); | |
image.src = DWObject.GetImageURL(DWObject.CurrentImageIndexInBuffer, 640, 480); | |
}; | |
DWObject.OpenSource(); | |
DWObject.IfDisableSourceAfterAcquire = true; | |
DWObject.AcquireImage(onSuccess, onFailure); | |
}, function () { | |
console.log('SelectSource failed!'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment