Code For Round Image in Android

ImageView imageView = (ImageView)findViewById(R.id.imageView);
Bitmap avatar = BitmapFactory.decodeResource(getResources(), R.drawable.background);
RoundedBitmapDrawable roundDrawable =
                                                          RoundedBitmapDrawableFactory.create(getResources(), avatar);
roundDrawable.setCircular(true);
imageView.setImageDrawable(roundDrawable);

Comments

Popular posts from this blog

How to Fix ‘This file name is too long’ Error?

General Knowledge