Wednesday, November 4, 2009

[android-developers] Draw GLSurfaceView to a Bitmap

I have an application that uses GLSurfaceView to draw OpenGL ES
graphics. This is all working (mostly) how I would expect.

Now, I would like to implement a screenshot feature. For normal
views, it seems that the standard practice is to create a new Canvas
with a Bitmap and then draw to that Canvas using View.onDraw(Canvas).

I've tried using SurfaceView.draw(Canvas) in a similar fashion, but it
always results in a blank (black) image.

I've also tried using the drawing cache with the exact same result.

Any ideas?

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment