How to freeze canva

Hi all !

I would like your help because I would like to be able to deactivate the drawing on a canva as soon as the finger is removed.

I draw a line all the time, and as soon as I take my finger off the screen, I wish it was impossible to redraw until I hit a button to reactivate.

Do you have an idea ? Thank you !!

One work arround is when canvas.touched up set paint color to transparent. When button click then change it to another color

it could have been a good solution for me, but unfortunately, if I put the color on transparent, it will be like an eraser, and I want to freeze the canva because I don’t want the image to be modified anymore (because I calculate the percentage of coloration)

Transparent color I believe won’t work as eraser. You have to use canvas background color as paint color in order to work as eraser.

1 Like

I will try this method, thanks.

1 Like

So, the idea is good, only for me it does not go ^^

I don’t really know how to do it, I’ll explain my project to you: in just one touch (i.e. without lifting your finger), you have to color the area of ​​the canva as much as possible. As soon as the finger is raised, it stops and the percentage is calculated.

But suddenly, as soon as I lift my finger, I can’t freeze the canva to avoid redrawing. If I set the color to transparent and rest my finger on the canva, the calculation process will start over, which I don’t want.

That’s why I’m looking for a way to deactivate the canva (like when we activate / deactivate a button for example)

Then maybe using a global variable might help


Great ! Thank you for your help, it was very simple but I had not thought of it!

Everything works, I will be able to move forward: D

Thanks again !

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.