0

I am currently using a View to trace the users fingers and draw lines depending on the color picked. I have set the background image using setBackGround() but I would now like to get the background + what the user user drawn into a variable. There exists getBackGround and getForeGround, not not both. How do I achieve this? I do not want to store the image locally on the persons phone.

The code used to achieve the tracing was used from this example and the setBackground was achieved by,

  dv = new DrawingView(this);
  dv.setBackground(imageview.getDrawable());

Where the imageview was defined and has data in it before.

J.Doe
  • 11
  • 3

1 Answers1

0

You have to pass view(name of the view), Where a view is like a relativeLayout

    view.setDrawingCacheEnabled(true);

    view.buildDrawingCache();

    Bitmap returnedBitmap = view.getDrawingCache();

    imageView.setImageBitmap(returnedBitmap);
ॐ Rakesh Kumar
  • 1,318
  • 1
  • 14
  • 24