bevy / photo-editor-android

Photo Editor SDK contains a lot of features like edit, scale, rotate and draw on images like Instagram stories.
MIT License
548 stars 189 forks source link

How to make scribble option to pertain even after cropping the image and re-setting #20

Closed Vaishnavi-optisol closed 5 years ago

Vaishnavi-optisol commented 6 years ago

I did some scribble on the image and done cropping and changed the original image with cropped one. Now the scribble part getting removed. Stickers/Emoji text everything is getting showed except the scribble.

Any idea to retain the scribble after cropping?

Vaishnavi-optisol commented 5 years ago

BrushDrawingView class -> We can comment this line "drawPath.reset();" in order to show the scribble even after cropping.

We can reset the path later on this method in same class. void clearAll() { if(drawCanvas!=null) { drawCanvas.drawColor(0, PorterDuff.Mode.CLEAR); if(drawPath!=null) drawPath.reset(); invalidate(); } }

I achieved above by this way. It can help someone

Vaishnavi-optisol commented 5 years ago

Above solution doesn't worked. It changes the color of already drawn scribble if we change the color and draw some other portion. So I just made image to be cropped along with drawings like parentview.getDrawingCanvas