1

I recently rebuilt my Android project to target 2.2 from 2.1.

In the old project, I did not specify a target SDK (the manifest did not contain something like: android:minSdkVersion="8"). This gave me an error in the console when running, but everything worked fine so I didn't fool with it.

The new project now uses android:minSdkVersion="8" in the manifest.

But now my drawables from the /drawable-nodpi/ folder are loading with scaling, making them much smaller and significantly changing the desired visuals.

If I cut out the tag from my manifest, they load properly without scaling.

Even when loading my images like so:

            BitmapFactory.Options opts = new BitmapFactory.Options();
            opts.inScaled = false;   
            Bitmap bm = BitmapFactory.decodeResource(_resources, resId, opts);

They are still scaled when I declare the minimum SDK in the manifest, but not scaled if I remove that tag.

Why is this happening? How can I load them without scaling while still declaring the minimum SDK?

Jack
  • 21
  • 1
  • 2
  • I am doing the exact same thing as you and my bitmaps are indeed loaded without scaling. The only thing I can think of is to make sure you don't have a bitmap of the same name in one of the other drawable folder – ADB Apr 10 '11 at 21:06

1 Answers1

1

Did you try this?

From Google:

If you plan on reading an image as a bit stream in order to convert it to a bitmap, put your images in the res/raw/ folder instead, where they will not be optimized.

ShadowGod
  • 7,891
  • 3
  • 28
  • 31
  • From my understanding of the documentation, that would be useful were I concerned with the compile-time optimization of images done by the aapt tool (reducing color palette from 256 to 128, for example). This is not the case -- my images are being loaded and scaled at run-time, ignoring the BitmapFactory.Options inScaled setting, and the /drawable-nodpi/ folder location, which is a separate issue. – Jack Oct 18 '10 at 21:22