Skip to content

Image and file scanning

The same decoder reads a still image. Nothing about the pipeline changes; only the tuning does, because a one-shot decode can afford to be exhaustive.

Live No camera needed
Ready

Pick an image

The component ships a hidden file input and the plumbing to read it. Opening it from your own button is a single call.

The second button skips the picker entirely: it renders a symbol into a pixel buffer and hands it to DecodeImage, which is the path an application uses when it sources images itself.

Results

0 total
Nothing scanned yet. Point the camera at a barcode, or use the sample codes.

Why still images differ

A camera gets another chance in fifty milliseconds, so a live frame should give up early. A file gets one chance, so BbScannerOptions.ForStillImages() raises the scan line count, enables the exhaustive detector path and allows inverted symbols.

var options = BbScannerOptions.ForStillImages();
options.Formats = BbBarcodeFormat.QrCode;

using var decoder = new BbBarcodeDecoder(options);
var result = decoder.Decode(pixels, width, height, BbPixelFormat.Rgba32);

Large photographs

A twelve megapixel photo carries no more barcode detail than a two megapixel one, so the component asks the browser to scale anything larger than 1600 pixels on its longest edge before it crosses into managed code. That alone is the difference between a snappy decode and a visible pause on a phone.

An unhandled error has occurred. Reload 🗙