0
点赞
收藏
分享

微信扫一扫

截屏分享

星巢文化 2023-03-31 阅读 60

public void getScreenShot(Rect shotRect) {

View view = context.getWindow().getDecorView();
view.setDrawingCacheEnabled(true);
view.buildDrawingCache();
bitmap = view.getDrawingCache();

bitmap = Bitmap.createBitmap(bitmap, shotRect.left, shotRect.top,
shotRect.right - shotRect.left, shotRect.bottom - shotRect.top);
view.setDrawingCacheEnabled(false);
}

举报

相关推荐

0 条评论