capacitor-community / barcode-scanner

A fast and efficient (QR) barcode scanner for Capacitor
MIT License
436 stars 172 forks source link

Is it possible to render in a div with width and something specific? #218

Closed danielchirinos closed 1 year ago

danielchirinos commented 1 year ago

hello everyone,

when i run the plugin it works correctly, but it appears on the whole screen, is it possible to make it appear in a div with defined width and height?

I tried to add the entire plugin within a component in ionic and I gave said component a fixed width and height, but it still opens the scan on the entire screen

Thanks in advance

JanMisker commented 1 year ago

No. The camera view is not embedded inside the DOM / component tree. It is rendered behind the webview. What you can do is place non-transparent content in your component that blocks the view partially, creating a similar effect. But do note that the qr recognition happens in the entire view, also in the blocked regions, and you can not specify a subregion.

danielchirinos commented 1 year ago

hi @JanMisker thanks for the answer, it was just a question I had since I wanted to leave it in a container. thanks once again!