RiccardoMoro / FreeDrawView

A View on which you can freely draw, customizing paint width, alpha and color, and take a screenshot of the content. Useful for note apps, signatures or free hand writing.
649 stars 117 forks source link

Support eraser? #5

Open KingWu opened 7 years ago

KingWu commented 7 years ago

Hi, it is nice job. but wanna to know whether support eraser? If not, i feel free to implement it.

RiccardoMoro commented 7 years ago

Thank you! Right now erase-mode it's not supported. Feel free to contribute :)

csbenz commented 7 years ago

Would be interested too, seems like a very useful feature :) Is it possible to easily add it with your implementation?

csbenz commented 7 years ago

In fact it's very simple to implement: set the stroke color to the background color. @KingWu do you have time to make a PR?

RiccardoMoro commented 7 years ago

Thank you all for the interest in my library! Yes, it's easiest way, but that may cause future problems if I'll add the option to set a background image (as I'm planning to do in the next release)

kojokey commented 7 years ago

Sounds very interesting, any idea how you would do that? Because the only way I can think of is to draw all the paths on a bitmap and use the PorterDuff.Mode.CLEAR mode to erase...

Right now, you're not drawing the paths on a bitmap but directly on the view.

RiccardoMoro commented 7 years ago

@kojokey Yes, that's the only way I can think of too.. But that means a lot of rework and changes in the code I guess. I'll take a look if I find something else

famecastle commented 7 years ago

Hi. I would really need this feature as well. Maybe this can help: https://stackoverflow.com/questions/17197435/trying-to-create-an-eraser-paint-for-canvas

I like your library because it's simple, effective, powerful and lightweight.

sudarshaana commented 5 years ago

Please implement "Eraser" that is very necessary for this library.