This file contains 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(); |
This file contains 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
class MyView1 extends PolymerElement { | |
static get template() { | |
return html` | |
<style include="shared-styles"> | |
:host { | |
display: block; | |
padding: 10px; | |
} | |
</style> |
This file contains 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
<my-app></my-app> | |
<script type="text/javascript"> | |
var DWObject; | |
// Get a free trial license key from https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx | |
// Dynamsoft.WebTwainEnv.ProductKey = 'LICENSE-KEY'; | |
Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', onReady); | |
function onReady() { | |
Dynamsoft.WebTwainEnv.CreateDWTObject(document.createElement('div'), function (obj) { |
This file contains 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
<script type="text/javascript"> | |
// Get a free trial license key from https://www.dynamsoft.com/CustomerPortal/Portal/Triallicense.aspx | |
Dynamsoft.WebTwainEnv.ProductKey = 'LICENSE-KEY'; | |
Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', onReady); | |
var DWObject; | |
function onReady() { | |
Dynamsoft.WebTwainEnv.CreateDWTObject(document.getElementById('doc-image'), function (obj) { | |
DWObject = obj; | |
}, function (errorString) { |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hello World</title> | |
<script type="text/javascript" src="Resources/dynamsoft.webtwain.initiate.js"></script> | |
<script type="text/javascript" src="Resources/dynamsoft.webtwain.config.js"></script> | |
</head> | |
<body> | |
<div id="dwtcontrolContainer" ></div> | |
<input type="button" value="Scan" onclick="AcquireImage();" /> |
This file contains 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
<!-- https://gist.github.com/Volcanoscar/4a9500d240497d3c0228f663593d167a --> | |
<script id="drawImage-fragment-shader" type="x-shader/x-fragment"> | |
precision mediump float; | |
varying vec2 v_texcoord; | |
uniform sampler2D u_texture; | |
uniform float u_colorFactor; | |
void main() { |
This file contains 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
var barcodereader = null; | |
(async()=>{ | |
barcodereader = await Dynamsoft.BarcodeReader.createInstance(); | |
await barcodereader.updateRuntimeSettings('speed'); | |
let settings = await barcodereader.getRuntimeSettings(); | |
settings.deblurLevel = 0; | |
barcodereader.updateRuntimeSettings(settings); | |
})(); | |
let canvas2d = document.createElement('canvas'); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script> | |
<script> | |
let scanner = null; | |
(async()=>{ | |
scanner = await Dynamsoft.BarcodeScanner.createInstance(); | |
scanner.onFrameRead = results => {console.log(results);}; | |
scanner.onUnduplicatedRead = (txt, result) => {alert(txt);}; |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/dbr.js" data-productKeys="PRODUCT-KEYS"></script> | |
<script> | |
let scanner = null; | |
(async()=>{ | |
scanner = await Dynamsoft.BarcodeScanner.createInstance(); | |
scanner.onFrameRead = results => {console.log(results);}; | |
scanner.onUnduplicatedRead = (txt, result) => {alert(txt);}; |
This file contains 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
const auto processor_count = std::thread::hardware_concurrency(); | |
int minimum_count = 1, minimum_timecost = 0; | |
for (int i = 0; i < processor_count; i++) | |
{ | |
printf("Thread count: %d. ", i + 1); | |
int timecost = barcode_decoding(buffer, size, formats, i, license, config); | |
if (i == 0) | |
{ | |
minimum_count = 1; | |
if (timecost > 0) |