I'm trying to scale a Bitmap object for Landscape mode on emulator. The code to create and scale the bitmap is placed below:
Using java Syntax Highlighting
- mBackgroundImage = BitmapFactory.decodeResource(res, R.drawable.background);
- mBackgroundImage = mBackgroundImage.createScaledBitmap(
- mBackgroundImage,
- display.getWidth(),
- display.getHeight(),
- true);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
Look at the parameter display.getHeight(). It should return the actual screen height, right? But it does not. The display.getWidth() parameter works fine. The bitmap's width is perfect, but its height is out of the screen. I don't understand. Is a display.getHeight() bug? If I change display.getHeight() for 220 the bitmaps height becomes correct.
E.g.:
Using java Syntax Highlighting
- mBackgroundImage = BitmapFactory.decodeResource(res, R.drawable.background);
- mBackgroundImage = mBackgroundImage.createScaledBitmap(
- mBackgroundImage,
- display.getWidth(),
- 220,
- true);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
Have someone been seen this problem before?
Thanks!


