jitsi / libjitsi

Advanced Java media library for secure real-time audio/video communication.
Apache License 2.0
628 stars 282 forks source link

ScreenCapture.grabScreen fills byte array with all -1 #70

Closed BenjaminFaal closed 8 years ago

BenjaminFaal commented 8 years ago

When i use the grabScreen method it fills my byte array with -1

What am i doing wrong?

                    Rectangle rect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
                    int width = rect.width;
                    int height = rect.height;
                    int size = width * height * 4;
                    while (true)
                    {
                        byte[] bytes = new byte[size];
                        boolean success = ScreenCapture.grabScreen(displayIndex, 0, 0, width, height, bytes);
                        // do something with the byte array
                    }
BenjaminFaal commented 8 years ago

Now i got it to work but i need to send it to android by a socket and read it as bitmap any ideas?

ibauersachs commented 8 years ago

As this isn't about a problem in libjitsi, please seek help in a Java forum.