The getResources() method is defined in the Context class so you'll need access to a context or be calling it from within a child class like an Activity.
On Jan 30, 2:26 am, lyon <[email protected]> wrote: > In ActionScript development, there are two classes, Bitmap, and > BitmapData. Bitmap uses information from BitmapData to create a > Bitmap. Is there an equivalent to BitmapData in the android API? I did > some digging and BitmapFactory seems to be the closest, however, I'm > facing problems with it. > > I tried > > Bitmap bitmap = BitmapFactory.decodeResource(getResources(), > R.drawable.buster); > > As that was what I was seeing in most of the examples I came across, > but it is telling me that the method getResources is undefined. I'm > not really sure what is causing this as in another tutorial I did, > getResources didn't cause any problems. > > I'm not looking to simply draw a bitmap to the screen, I want to copy > a section of the bitmap and place it on a new bitmap. In ActionScript, > the method is bitmapData.copyPixels(), and I'm looking for a similar > method in the Android API. The closest thing I could find was > copyPixelsToBuffer(), but I'm not really sure if that does what I > think it does. > > Any help is greatly appreciated -- 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

