Skip to content Skip to sidebar Skip to footer

Android - Does Decoderesource Scale The Bitmap For Screen Density?

In Android development, will Bitmap bmpNormal = BitmapFactory.decodeResource(res, R.drawable.normal); load the bitmap from the correct drawables-density folder, or do I need to ma

Solution 1:

Actually you should provide the resources in all the folders -ldpi -mdpi -hdpi -xhdpi Android will automatically customize it and use it in correct layouts.The resources provided should be of the correct sizes.Checkout this link.You can know how the android customizes the images in an app.You can also scale bitmap and use it but its more complicated meathod.

Solution 2:

Yes a drawables density specific bitmap will be loaded.

Post a Comment for "Android - Does Decoderesource Scale The Bitmap For Screen Density?"