Android interface change shots, interception of the current screen picture

Some time ago the company has a need to do when we read the project need a magnifying glass, but how images are displayed at a finger in that circle, which we need to develop a position, or develop content control currently displays make a screenshot . We can get the shots we wanted View display corresponding to the following method

private Bitmap getScreenBm(View contentView) {
    Bitmap bm;
    contentView.destroyDrawingCache();
    contentView.setDrawingCacheEnabled(true);
    contentView.buildDrawingCache();
    bm = contentView.getDrawingCache();
    //指向的当前view的显示对象的缓存bm,如果view里控件增加等改变,bm相应改变
    return bm;
}

Here is what we want to return to the Bitmap to get the shots, we can make the appropriate Bitmap processing, in order to achieve the screenshot function.

Guess you like

Origin blog.csdn.net/weixin_38322371/article/details/88617152