Android图片圆角处理
2011-08-02 22:26
671 查看
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); Canvas canvas = new Canvas(output); final int color = 0xff424242; final Paint paint = new Paint(); final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); final RectF rectF = new RectF(rect); final float roundPx = 12; paint.setAntiAlias(true); canvas.drawARGB(0, 0, 0, 0); paint.setColor(color); canvas.drawRoundRect(rectF, roundPx, roundPx, paint); paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); canvas.drawBitmap(bitmap, rect, rect, paint); return output; }
相关文章推荐
- android 圆角图片 处理
- Android图片圆角处理
- android 圆角图片 处理
- android 图片处理(图片合成、图片圆角、图片翻转、图片缩放)
- android图片的缩放、圆角处理
- Android腾讯微薄客户端开发七:图片加圆角以及时间处理工具类
- Android图片处理——压缩、剪裁、圆角、保存
- Android 图片加圆角以及时间处理工具类
- Android图片缩放、圆角处理以及倒影特效代码
- Android中几种图像特效处理的小技巧,比如圆角,倒影,还有就是图片缩放,Drawable转化为Bitmap,Bitmap转化为Drawable等等
- android图片圆角处理,重写onDraw方法
- android 图片圆角处理
- android 圆角图片 处理
- android 背景圆角以及图片圆角处理
- android 指定组件的圆角图片处理
- Android 利用多线程异步加载图,并把图片处理成圆角,并更新视图
- android图片圆角、图片去色处理示例
- android中处理图片成圆角
- Android 图片缩放,图片圆角处理
- Android图片处理——压缩、裁剪、圆角、保存