local image starting with file:// won't work #219
-
Describe the bug I now get the error "please set image!" Devlopment environment(please complete the following information):
Smartphone (please complete the following information):
Additional context EDIT: actually even with a local image using require('pathToImage') I still get the same error :/ |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hello @pierroo, can you provide me a sample code about how you use the library? |
Beta Was this translation helpful? Give feedback.
-
Of course @JimmyDaddy , here it is:
|
Beta Was this translation helpful? Give feedback.
-
@pierroo the API has been changed in v1.x.x, you should modify you code like below viewShotRefs?.current
.capture()
.then(async (uri) => {
console.log('view shot: ', uri);
try {
const markRes = await ImageMarker.markText({
backgroundImage: {
src: uri,
scale: 1,
},
watermarkTexts: [
{
text: 'blablabla',
position: {
position: Position.bottomRight,
},
style: {
color: '#ffffff',
fontSize: 36,
shadowStyle: {
dx: 1,
dy: 1,
radius: 10,
color: '#000000',
},
},
},
],
scale: 1,
quality: 100,
saveFormat: ImageFormat.base64,
});
goShare(markRes);
} catch (err) {
console.log('error marking img: ', err);
}
})
.catch((e) => {
console.log('could not capture full canvas: ', e);
}); |
Beta Was this translation helpful? Give feedback.
@pierroo the API has been changed in v1.x.x, you should modify you code like below