On Sun, May 23, 2010 at 2:06 PM, davemac <[email protected]> wrote: > Sounds like your bitmap is being scaled before it is returned to your > code.
What scaling math would produce a 48x48 bitmap from a 480x320 bitmap? Even if you're correct, the ratio is wrong. This only started when I factored out to a library project. > Could you post some code so we can see what you're trying to do? > Android might perform scaling to match screen density. No scaling should be required, I'm working in an HVGA emulator with a screen size of precisely 480x320. This code worked fine before it became a library project. Bitmap bg_image = BitmapFactory.decodeResource( getResources(), com.cyberfusion.libbackground.R.drawable.bg_grey ); Bitmap bm = Bitmap.createBitmap( bg_image, 0, 0, 480, 320 ); BitmapDrawable drawable = new BitmapDrawable( bm ); outer_layout.setBackgroundDrawable( drawable ); My debug code shows me bg_image is not null and is 48x48: Log.i( "l", "bg_image: " + bg_image ); Log.i( "l", "bg_image.getWidth(): " + bg_image.getWidth() ); Log.i( "l", "bg_image.getHeight(): " + bg_image.getHeight() ); I can assure you, R.drawable.bg_grey is 480x320. -- Greg Donald destiney.com | gregdonald.com -- 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

