Problem with the Bitmap to take screenshots

175 views Asked by At
  1. I have this line of code for taking screenshots I take the screenshot but somethimes the image only show a white backgroud and doesn't show the full color of the image how can I solve this?
  2. Postdata I have other question with the fullcode Problem with taking screenshots with the media projection android studio and I discover that the problem happened with this line of code.

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

bitmap.copyPixelsFromBuffer(buffer);

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

1

There are 1 answers

1
Emarcia On

The problem is in the compression of your image.

Check out the link below