【发布时间】:2019-01-27 15:06:55
【问题描述】:
我有从Expo ImagePicker component 返回的 base64 格式的图像数据,我想将其转换为 [r0, g0, b0, a0, r1, g1, b1, a1, .. .],因为这是jsQR library接受的唯一输入
我试过了,但没有用:
const dataURItoBlob = byteString => {
// write the bytes of the string to a typed array
var ia = new Uint8ClampedArray(byteString.length);
for (var i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i);
}
return ia;
};
我们将不胜感激任何帮助
【问题讨论】:
标签: javascript image react-native qr-code