I'm not sure if this will work in your situation, but try calling setWillNotCacheDrawing this on the View 'l' as well:
boolean drawsCache = l.willNotCacheDrawing(); l.setWillNotCacheDrawing(false); Bitmap dragPicture = Bitmap.createBitmap(l.getDrawingCache()); l.setWillNotCacheDrawing(drawsCache); On Monday, November 17, 2008 5:34:07 AM UTC-5, Jose Cortes wrote: > > Hello everybody. > > I am working with OpenGL and Android, and I was wondering if there is > any way to create a Bitmap or a Drawable using a view (layout). The > purpose is to use this Bitmap as Texture for an OpenGL figure. > > All I have untill now is: > > ** I create a new view from the context and the Id. > > View l = new View(context); > > l.findViewById(R.layout.main); > > ** I used DrawingCache...but dont know if it is well used: > > l.setDrawingCacheEnabled(true); > > Bitmap bmp = l.getDrawingCache(); > > this bmp is null... > > > Any idea? > > Thanks -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en