- public static Bitmap getRoundCornerImage(Bitmap bitmap, int roundPixels)
- {
-
- Bitmap roundConcerImage = Bitmap.createBitmap(bitmap.getWidth(),
- bitmap.getHeight(), Config.ARGB_8888);
-
- Canvas canvas = new Canvas(roundConcerImage);
-
- Paint paint = new Paint();
-
- Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
- RectF rectF = new RectF(rect);
-
- paint.setAntiAlias(true);
-
- canvas.drawRoundRect(rectF, roundPixels, roundPixels, paint);
-
- paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN));
-
- canvas.drawBitmap(bitmap, null, rect, paint);
- return roundConcerImage;
- }
图片圆角效果,布布扣,bubuko.com
图片圆角效果
原文:http://www.cnblogs.com/clarence/p/3838095.html