android 使图片显示 圆角
来源:互联网 发布:小女孩连裤袜淘宝 编辑:程序博客网 时间:2024/05/17 11:35
类似上面的效果,将方形图片 显示为圆角图
//获得圆角图片的方法 public Bitmap getRoundedCornerBitmap(Bitmap bitmap,float roundPx){ 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); 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 ListView显示图片
- android 显示gif图片
- Android显示在线图片
- Android 网络图片显示
- Android 显示图片
- android 图片缩略图显示
- android显示gif图片
- Android显示GIF图片
- Android TextView显示图片
- android显示gif图片
- Android显示网络图片
- android 显示gif图片
- android 显示图片
- android显示GIF图片
- Android显示gif图片
- asp.net 获取网站根目录
- annotation 中的autowire
- Android RoboGuice EventManager用法
- 自定义加载进度条loading的几种方式
- 一道经典面试题“I love china”的实现
- android 使图片显示 圆角
- A. Domino piling
- 大侠们 谁用 C#做过 USB指令打印的?
- java设计模式总结篇--行为型模式(2)
- 非模态窗口模拟模态窗口
- 代码适当的重复,也有好处
- UITextView 和 UITextField 的提示信息placeholder
- 多文档DOC/VIEW框架不创建新文档
- Oracle PGA 管理