MonkeyBonkey
MonkeyBonkey

Reputation: 47901

how to alias or smooth scaled down image in android

I'm setting a larger image to a ImageView in Android using the Android Universal ImageLoader. However, I'm getting jagged or non-smooth edges when the image gets scaled down. Is there an option I can set in the imageview to have a smoother edges when scaling down of the image?

Upvotes: 0

Views: 1006

Answers (1)

Sunny
Sunny

Reputation: 14818

You can try setting ImageScaleType to EXACTLY and you can also set Bitmap.Config to ARGB_8888 for better photos.

DisplayImageOption options = new DisplayImageOptions.Builder().showStubImage(R.drawable.ic_launcher).showImageForEmptyUri(
            R.drawable.ic_launcher).showImageOnFail(R.drawable.ic_launcher).cacheInMemory()
            .resetViewBeforeLoading().showStubImage(R.drawable.ic_launcher).imageScaleType(
                    ImageScaleType.EXACTLY).cacheOnDisc().bitmapConfig(Bitmap.Config.RGB_565).build();

Upvotes: 1

Related Questions