位图拍摄屏幕截图时出现问题

时间:2020-10-01 01:29:47

标签: android android-studio bitmap screenshot android-mediaprojection

  1. 我有用于捕获屏幕截图的这一行代码,但有一些thimeimes,图像仅显示白色背景,而没有显示图像的全彩色,我该如何解决呢?
  2. Postdata我对完整代码Problem with taking screenshots with the media projection android studio还有其他疑问,我发现问题出在这行代码上。

位图= Bitmap.createBitmap(mWidth + rowPadding / pixelStride,mHeight,Bitmap.Config.ARGB_8888);

bitmap.copyPixelsFromBuffer(buffer);

bitmap.compress(Bitmap.CompressFormat.PNG,100,fos);

1 个答案:

答案 0 :(得分:0)

问题出在图像压缩上。

Check out the link below