getDrawingCache() will work only if you either enable the drawing cache on the View or call buildDrawingCache() first. If you do this manually make sure to disable/destroy the drawing cache when you are done. Otherwise, every time the view is invalidated, it will have to update the drawing cache. This is bad for Views that invalidate often, like MapView.
Because the drawing cache API is a bit difficult to use properly, I recommend you instead simply create your own Bitmap, create a Canvas for that Bitmap and then call view.draw(canvas). On Fri, Oct 10, 2008 at 2:13 PM, sandroid <[EMAIL PROTECTED]> wrote: > > Hello, > I want to use getDrawingCache() to get a Bitmap from MapView, > but I'm not sure where or when to call the routine. In my ViewGroup > there is a dispatchDraw(Canvas) routine, but it seems to me like I > want to call getDrawingCache() after or during the MapView draw() > routine. > > Does anybody know much about getDrawingCache()? I cannot find a good > example online or in the ApiDemos. Ideally I would like to be able to > do this for any View. > > -Marc > > > > -- Romain Guy www.curious-creature.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

