So I’ve been trying to find a way to grab the screen and save it as a bitmap.

Problem is, the ScreenshotAppState from the desktop engine isn’t working with android,

as the readFrameBuffer function isn’t implemented on android:

[java]public void readFrameBuffer(FrameBuffer fb, ByteBuffer byteBuf) {

logger.warning(“readFrameBuffer is not supported.”);


Anyway, I was wondering if anyone In here got an idea on how to capture the content of the GLSurfaceView?

Regards, MrAdam.

Run on desktop?

@normen said:
Run on desktop?

This is an android app Im working on. I need to pass the screenshot as a bitmap to another activity.

May I ask why? If you did everything in jME3 you can simply use preViews and render to another texture. Also the app would run on other platforms as well.

Well, JME is just used to show a 3D model inside my XML layout, where it can then be rotated and such.

Then its shown above a camera view, where it rotates according to the gyroscope so you can place it (like VR).

I have a button that you press which grabs the camera surface’s pixels,

and then I need the pixels from the GLSurfaceView as well so I can draw them on top of it.

Yeah, all doable in jME3 with nifty as well. And would then work on a laptop or maybe in the future on iOS too. Anyway, just sayin’, I have no idea about android as you don’t need to with jME3 ;).


still have problems implementing this

normally we you would get the drawingcache of the view or draw the surfaceview in a bitmap

but how can we deal with this in jme android?