Bitmap circular clipping in Android

I have a square bitmap displayed under a translucent circle. Users can touch and drag the bitmap to locate it. I want to be able to crop any part of the bitmap. How can I do this?

resolvent:

Look at the roundedbitmapdrawable in the support library

All you have to do is give it a bitmap and corner radius

RoundedBitmapDrawable img = RoundedBitmapDrawableFactory.create(getResources(),bitmap);
img.setCornerRadius(radius);

imageView.setImageDrawable(img);

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>