Open GoogleCodeExporter opened 9 years ago
first try to read the pixels after creating the scene, so after all the objects
are traversed. so just put it at the end of the draw method. and the difficult
part will be to merge the opengl bitmap with the camera image;)
maybe you should move your code to a seperate class otherwise you might get
problems when the renderer class is changed.
Original comment by simon.heinen
on 22 Sep 2011 at 3:19
Hi Simon,
Thank you for your answer. Actually my first attempt was putting the code at
the end of the onDrawFrame method --> same result.
Do you mean that the the opengl bitmap is an overlay above the camera view? I
thought you were merging all those elements... (it explains my black image).
Original comment by dev.hidd...@gmail.com
on 22 Sep 2011 at 3:38
jep they are two separate overlays (the camerapreview and the opengl surface
view) so currently you are only getting the information from the opengl view.
im using glReadPixel in a similar way in the ObjectPicker (
http://code.google.com/p/droidar/source/browse/trunk/droidar/DroidAR/src/gl/Obje
ctPicker.java ) class:
ByteBuffer pixelBuffer = ByteBuffer.allocateDirect(4);
pixelBuffer.order(ByteOrder.nativeOrder());
gl.glReadPixels(x, y, 1, 1, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE,
pixelBuffer);
byte b[] = new byte[4];
pixelBuffer.get(b);
so it should be possible to read all pixels on the screen this way (im not sure
if its the best way, sounds a little inefficient;). just make sure that you do
this after rendering all the objects in the elementsToRender list
the merging with the camera preview should be possible to if you write some
little helper methods to manage the transparency in the opengl view. i'm
currently busy learning for 2 exams but i should have some time in about one
week, you can post your progress here till then.
Original comment by simon.heinen
on 22 Sep 2011 at 6:21
Thanks simon! Actually I also quite busy right now, but I'll try to have a look
at it later. I'll keep you posted!
Original comment by dev.hidd...@gmail.com
on 23 Sep 2011 at 7:57
have this been successful? thank you I also want to capture an image with the
openGL bitmaps
Original comment by dwayne.b...@gmail.com
on 3 Oct 2012 at 2:56
this framework is so nice,but i can't use it taking pictures.who can help me?
Original comment by liuting....@gmail.com
on 6 Nov 2014 at 1:58
Original issue reported on code.google.com by
dev.hidd...@gmail.com
on 22 Sep 2011 at 1:52Attachments: