omerjerk / Screenshotter

A library to take screenshots without root access
58 stars 26 forks source link

Buffer not large enough for pixels #2

Open duard opened 8 years ago

duard commented 8 years ago
09-05 11:00:24.183 9896-9896/in.omerjerk.screenshotter D/AndroidRuntime: Shutting down VM
09-05 11:00:24.183 9896-9896/in.omerjerk.screenshotter E/AndroidRuntime: FATAL EXCEPTION: main
                                                                         Process: in.omerjerk.screenshotter, PID: 9896
                                                                         java.lang.RuntimeException: Buffer not large enough for pixels
                                                                             at android.graphics.Bitmap.copyPixelsFromBuffer(Bitmap.java:535)
                                                                             at in.omerjerk.libscreenshotter.Screenshotter.onImageAvailable(Screenshotter.java:131)
                                                                             at android.media.ImageReader$ListenerHandler.handleMessage(ImageReader.java:648)
                                                                             at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                             at android.os.Looper.loop(Looper.java:148)
                                                                             at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                             at java.lang.reflect.Method.invoke(Native Method)
                                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
amnazhatdinov commented 8 years ago

Try it by replacing Bitmap.Config.ARGB_8888 to Bitmap.Config.RGB_565.

CraftsmanHyj commented 6 years ago

Try it by replacing Bitmap.Config.ARGB_8888 to Bitmap.Config.RGB_565.

not woking

zyfdegh commented 3 years ago

I changed to ALPHA_8 and it works.