You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
config.template="{\"ImageParameter\":{\"BarcodeFormatIds\":[\"BF_QR_CODE\"],\"Description\":\"\",\"Name\":\"Settings\"},\"Version\":\"3.0\"}"; //scan qrcode only
config.template="{\"ImageParameter\":{\"BarcodeFormatIds\":[\"BF_QR_CODE\"],\"Description\":\"\",\"Name\":\"Settings\"},\"Version\":\"3.0\"}"; //scan qrcode only
53
+
54
+
const results:TextResult[] =decode(frame,config)
55
+
REA.runOnJS(setBarcodeResults)(results);
56
+
}, [])
57
+
58
+
React.useEffect(() => {
59
+
(async () => {
60
+
const status =awaitCamera.requestCameraPermission();
61
+
setHasPermission(status==='authorized');
62
+
})();
63
+
}, []);
64
+
65
+
return (
66
+
device!=null&&
67
+
hasPermission&& (
68
+
<>
69
+
<Camera
70
+
style={StyleSheet.absoluteFill}
71
+
device={device}
72
+
isActive={true}
73
+
frameProcessor={frameProcessor}
74
+
frameProcessorFps={5}
75
+
/>
76
+
{barcodeResults.map((barcode, idx) => (
77
+
<Text key={idx} style={styles.barcodeText}>
78
+
{barcode.barcodeFormat+": "+barcode.barcodeText}
79
+
</Text>
80
+
))}
81
+
</>
82
+
)
83
+
);
84
+
}
85
+
86
+
const styles =StyleSheet.create({
87
+
container: {
88
+
flex: 1,
89
+
alignItems: 'center',
90
+
justifyContent: 'center',
91
+
},
92
+
barcodeText: {
93
+
fontSize: 20,
94
+
color: 'white',
95
+
fontWeight: 'bold',
96
+
},
97
+
});
98
+
99
+
```
100
+
101
+
2. Scan barcodes from a base64-encoded static image.
102
+
103
+
```ts
104
+
let results =awaitdecodeBase64(base64);
105
+
```
106
+
107
+
3. License initialization ([apply for a trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr)).
0 commit comments