【问题标题】:Problem with the Bitmap to take screenshots位图截图问题
【发布时间】:2021-01-16 17:39:04
【问题描述】:
  1. 我有这行用于截屏的代码 我截屏了,但有时图像只显示白色背景,没有显示图像的全彩,我该如何解决?
  2. Postdata 我对完整代码Problem with taking screenshots with the media projection android studio 有其他问题,我发现问题出在这行代码上。

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

bitmap.copyPixelsFromBuffer(buffer);

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

【问题讨论】:

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


    【解决方案1】:

    问题在于图像的压缩。

    Check out the link below

    【讨论】:

    • 压缩是正确的,代码中的主要问题是方法之一,非常感谢您尝试帮助我
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-15
    • 2020-02-07
    相关资源
    最近更新 更多