我试过的代码
它有效,但黑色视频区域:
View view = this.cordova.getWindow().getDecorView().getRootView();
view.setDrawingCacheEnabled(true);
bitmap = Bitmap.createBitmap(view.getDrawingCache());
view.setDrawingCacheEnabled(false);
也可以,但黑色视频区域:
Display display = this.cordova.getActivity().getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
View view =
this.cordova.getActivity().getWindow().getDecorView().getRootView();
bitmap = Bitmap.createBitmap(size.x, size.y, Bitmap.Config.ARGB_8888);