mukeshsolanki / DrawingView-Android

DrawingView is a simple view that lets you draw on screen using your fingers and lets you save the drawings as images.
MIT License
240 stars 53 forks source link

How to clear the DrawingView? #7

Closed lennertsneyders closed 7 years ago

lennertsneyders commented 7 years ago

When I draw some lines or when I load a bitmap in the view, how to clear it so I can start over again?

ravir13 commented 7 years ago

I cannot draw over a bitmap. The line vanishes.

hcz017 commented 7 years ago

@ravir13 you can implement by add one line code:

  public void loadImage(Bitmap bitmap) {
    mBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
+    mCanvas = new Canvas(mBitmap);
    bitmap.recycle();
    invalidate();
  }