Closed bmabir17 closed 3 years ago
@bmabir17 oriCanvas saves the source image in a canvas. While you need to draw the barcode location yourself using localizationresult.
some sample code copied from BarcodeScanner:
ctx.fillStyle = this.barcodeFillStyle;
ctx.strokeStyle = this.barcodeStrokeStyle;
ctx.lineWidth = this.barcodeLineWidth;
results = results || [];
for(let result of results){
let loc = result.localizationResult;
ctx.beginPath();
ctx.moveTo(loc.x1, loc.y1);
ctx.lineTo(loc.x2, loc.y2);
ctx.lineTo(loc.x3, loc.y3);
ctx.lineTo(loc.x4, loc.y4);
ctx.fill();
ctx.beginPath();
ctx.moveTo(loc.x1, loc.y1);
ctx.lineTo(loc.x2, loc.y2);
ctx.lineTo(loc.x3, loc.y3);
ctx.lineTo(loc.x4, loc.y4);
ctx.closePath();
ctx.stroke();
}
I am trying to get results from image files using the Dynamsoft.DBR.BarcodeReader as follows
I am getting the results of the bar code as text. But i also want the image that is marked with the bar code location. would i be able to get that using
getIntermediateResults();
method ?