Monday, October 10, 2011

[android-developers] Re: Bitmap's getWidth problem

You have two options, use the BitmapFactory + BitmapFactory.Options like this:

BitmapFactory.Options bfoOptions = new BitmapFactory.Options();
bfoOptions.inScaled = false;
BitmapFactory.decodeResource( rMgr, ResID, bfoOptions );

Or you can put all the resources you don't want scaled in the drawable-nodpi directory here:

Project/res/drawable-nodpi/resource.png

I've used them both and they seem to both work equally well. If you want the option of deciding to scale or not via a preference or similar, the code edition would probably be the better choice.

Steven
Studio LFP
http://www.studio-lfp.com


On Monday, October 10, 2011 10:36:09 PM UTC-5, Perry168 wrote:
Hi all,
   I found that the problem not come from 2.1 or 2.2.
  When the AVD is using HVGA, the image resolution will display 574.
But if AVD is using WVGA800, it will display 861.
How can I get the correct image's width and height?
Thanks a lot!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment