截屏分享

阅读 60

2023-03-31

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)

0 0 举报