As title,
g.getWidth()/getHeight()
return this value on the emulator with an avd
320x569
Is there someone who can help me understanding why please?


pskink wrote:see docs about <supports-screens> in the manifest
http://developer.android.com/intl/fr/gu ... ement.html


pskink wrote:if you want to support level3 (v1.5) then you cannot use <supports-screens> tag in the manifest

pskink wrote:if you want to support level3+ your display will always have 320x480 regardless of device physical dimensions (compatibility mode) and everything will be scaled to that size


sblantipodi wrote:Ok, suppose that I don't want to support Android 1.5 and I don't want to put my images in
drawable-nodpi
is it possible to draw a not resized image on a canvas on a WVGA resolution using level4?
if yes, how?

pskink wrote:sblantipodi wrote:Ok, suppose that I don't want to support Android 1.5 and I don't want to put my images in
drawable-nodpi
is it possible to draw a not resized image on a canvas on a WVGA resolution using level4?
if yes, how?
you mean Bitmap which is not taken from any /res/* folder?

sblantipodi wrote:I mean bitmap that is taken from the standard drawable folder,
how can I draw a bitmap taken from this standard folder in an unresized way on Android 4 or later?
If I can do it, I can solve the problem of Level3 with an astract class that load dinamically the images on runtime.
So my questions is.
how can I draw a bitmap taken the standard drawable folder in an unresized way on Android 4 or later?
Thanks!!!!!

pskink wrote:res = getResources()
opts.inScaled = false
bitmap = BitmapFactory.decodeResource(res, R.drawable.img, opts)
but i think that you cannot support both large screens and level3


sblantipodi wrote:I put this in the constructor:Using java Syntax Highlighting
BitmapFactory.Options opts = new BitmapFactory.Options(); opts.inScaled = false; logo = BitmapFactory.decodeResource(getResources(), R.drawable.logo, opts);Parsed in 0.034 seconds, using GeSHi 1.0.8.4
and this in the onDraw()Using java Syntax Highlighting
g.drawBitmap(logo, 0, 0, new Paint());Parsed in 0.035 seconds, using GeSHi 1.0.8.4
The problem is.
logo.getWidth() returns the correct unscaled width, but when I draw it with drawBitmap()
it draws the scaled Bitmap. :shock:

Return to SDK/ADT/Emulator Problems
Users browsing this forum: No registered users and 11 guests