本地图片形状做成圆形
把本地图片形状做成圆形方法:
//id(drawable类型)
publicstaticvoidsetcircle(Contextcontext,intid,ImageViewimg)
{
Bitmapbitmap=BitmapFactory.decodeResource(context.getResources(),id);
RoundedBitmapDrawablemRound
=RoundedBitmapDrawableFactory.create(context.getResources(),bitmap);
mRound.setCircular(true);
img.setImageDrawable(mRound);
}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。