DrawableView icon indicating copy to clipboard operation
DrawableView copied to clipboard

Can we set a bitmap as the canvas background?

Open ankitbatra11 opened this issue 8 years ago • 1 comments

Sorry, did not have much time now to go through but does it provide a method to set an image as the canvas background so we can draw over that image?

ankitbatra11 avatar Apr 25 '17 08:04 ankitbatra11

I have a solution.

  1. You can set background like this: drawableView.setBackground(new BitmapDrawable(bitmap));
  2. Paint others on the background.
  3. Then obtain bitmap call: drawableView.obtainBitmap(bitmap.copy(Bitmap.Config.ARGB_8888, true)); Note: If you want clear the canvas, you can call: drawableView.setBackground(null); drawableView.clear(); Hope to help you.

liuyangping avatar Jun 21 '19 07:06 liuyangping