Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to save customized SketchCanvas #239

Open
nueza99 opened this issue Dec 1, 2023 · 0 comments
Open

How to save customized SketchCanvas #239

nueza99 opened this issue Dec 1, 2023 · 0 comments

Comments

@nueza99
Copy link

nueza99 commented Dec 1, 2023

Hi
I am customizing my canvas to be able to add text, sketch, images etc. so this is very short code of it. I have Save button, and need to get the image file path, but I am not sure how to get that. Always getting undefined
This is my code

<SketchCanvas ref={sketchCanvasRef} style={{ backgroundColor: 'transparent', flex: 1, position: 'absolute', top: 0, bottom: 0, left: 0, right: 0, }} strokeWidth={5} strokeColor={isStrokeColor} touchEnabled={isPencil || isEraser ? true : false} savePreference={() => { return { folder: 'NiRNSketchCanvas', filename: String(Math.ceil(Math.random() * 100000000)), transparent: false, imageType: 'png', }; }} // onSketchSaved={handleSave} />

and this is my save button

<View> <TouchableOpacity style={styles.functionButton} onPress={handleSave}> <Text style={{color: 'white'}}>Save</Text> </TouchableOpacity> </View>

and this is my save function
` const handleSave = () => {

  //HERE I AM THINKING IT IS SAVED TO CAMERA ROLL AND NEED TO GET THE IMAGE URL PATH

};`

if i use RNSketchCanvas(use saveComponent & savePreferences) it get saved to my camera roll, but if i use Sketch Canvas, not save into my camera roll.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant