I need to convert my SurfaceView's content into a Bitmap. I tried to achieve this using the following code snippet inside the SurfaceView:
public final Bitmap getScreenCopy() {
Bitmap bitmap = Bitmap.createBitmap(
getWidth(),
getHeight(),
Bitmap.Config.ARGB_8888
);
Canvas temporaryCanvas = new Canvas(bitmap);
draw(temporaryCanvas); // Voodoo.
return bitmap;
}
The bitmap I receive from that drone seems to be transparent, does anyone know how to fix that?
Using a TextureView is not possible, since I use the Parrot SDK and the drone needs a SurfaceView to display the Frames.