posted 16 years ago
I need to scale an Image to fit the displayable area of the screen. Currently, I am calculating the scale ratio using constants 320 and 480(width x height) (i.e. emulator skin: HVGA-P screen size).
It is fair to assume that different devices will have different width and height. For my code to become independent of this, I need the width and height of the device screen at run time.
I tried canvas.getHeight() and canvas.getWidth() but it gave a result, I could not understand.(For HVGA-P, I got width = 603, height = 444)
Is there a class that can help here?
Also, when I rotate the emulator by 90 degrees using the PgUp button on the numpad, the emulator display changes from portrait to landscape, does this happen on actual device too?
Thanks.