Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

How to clear the DrawingView? #7

Closed
lennertsneyders opened this issue May 18, 2017 · 2 comments
Closed

How to clear the DrawingView? #7

lennertsneyders opened this issue May 18, 2017 · 2 comments

Comments

@lennertsneyders
Copy link

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
Copy link

ravir13 commented Jun 15, 2017

I cannot draw over a bitmap. The line vanishes.

@hcz017
Copy link
Contributor

hcz017 commented Jul 13, 2017

@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();
  }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants