Does auto scaling work fine on phone screens, but not on tablets?

I am writing a game for Android and I have a problem with auto scaling of the bitmap.

My phone is a Motorola Droid and it works great on it. When I run AVD with the same resolution for my phone running 2.2, it works fine, and if I run AVD with a smaller screen (320x240) and AndroidOS 1.6, it scales the bitmaps correctly and it looks just fine.

But when I run it on AVD version 3.0 and the big screen (emulating a tablet), the bitmap images do not scale at all. My code finds a location where to draw everything based on the height of the screen, so everything is drawn in the right place, just without scaling the bitmap.

The problem is that if I write code to scale bitmaps based on the height of the screen, then when I run it on AVD using a small screen, it ends up tiny, because it becomes TWICE reduced - once my own code and one times using the autoscale code.

Any help?

+3
source share
2 answers

I feel like a noob. The answer to my problem was simply to change the way I draw on the screen. I use Canvas.DrawBitmap, but I used a version that only skips the x and y points on the screen, which allows me to scale the autoscaler handle. I switch to the version using Rect for the destination, which allows me to specify exactly where my graphics are drawn on the screen, including height / width.

+1

, targetSdkVersion 11, . ?

0

All Articles