private static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int roundPixels, Rect srcRect, Rect destRect, int width,
int height) {
Bitmap output = Bitmap.createBitmap(width, height, Config.ARGB_8888);
Canvas canvas = new Canvas(output);
final Paint paint = new Paint();
final RectF destRectF = new RectF(destRect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(0xFF000000);
canvas.drawRoundRect(destRectF, roundPixels, roundPixels, paint);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(bitmap, srcRect, destRectF, paint);
return output;
}
RoundedBitmapDisplayer.java 文件源码
java
阅读 38
收藏 0
点赞 0
评论 0
项目:android-project-gallery
作者:
评论列表
文章目录