Skip to content

How to save customized SketchCanvas #239

@nueza99

Description

@nueza99

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions