我目前正在使用“视图”来跟踪用户的手指并根据所选择的颜色绘制线条。我已经使用setBackGround()
设置了背景图片,但是现在我想获取背景+用户用户绘制到变量中的内容。存在getBackGround和getForeGround,不是两者都存在。我该如何实现?我不想将图像本地存储在人员电话上。
this example使用了用于实现跟踪的代码,而setBackground
是通过
dv = new DrawingView(this);
dv.setBackground(imageview.getDrawable());
定义了图像视图并在其中包含数据的地方。
答案 0 :(得分:0)
您必须传递view(视图的名称),其中视图类似于relativeLayout
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
Bitmap returnedBitmap = view.getDrawingCache();
imageView.setImageBitmap(returnedBitmap);