YanYuanFE / react-native-signature-canvas

:black_nib: React Native Signature Component based WebView Canvas for Android && IOS && expo
MIT License
419 stars 150 forks source link

Background & Overlay Image Source - From File #194

Open Panthjeet opened 2 years ago

Panthjeet commented 2 years ago

Is there a way to use an image from local directories instead of a URL?

YanYuanFE commented 2 years ago

You can convert local files to url using

Panthjeet commented 2 years ago

It looks like the rest of your response was cut off.

IreNadee commented 2 years ago

@Panthjeet I have the same problem. did you get a solution?

IreNadee commented 2 years ago

import square from '../../../assets/images/quesImg/square.png'; const imgUrl = Image.resolveAssetSource(square).uri; <SignatureScreen ref={ref} overlaySrc={imgUrl} overlayWidth={imgWidth} overlayHeight={imgHeight} webStyle={style} onOK={handleOK} /> Using this I was able to load the image.