0
public static Bitmap getRoundedShape(Bitmap scaleBitmapImage,int width) { int targetWidth = width; int targetHeight = width; Bitmap targetBitmap = Bitmap.createBitmap(targetWidth, targetHeight,Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(targetBitmap); Path path = new Path(); path.addCircle(((float) targetWidth - 1)/2, ((float) targetHeight - 1)/2, (Math.min(((float) targetWidth), ((float) targetHeight))/2), Path.Direction.CCW); canvas.clipPath(path); Bitmap sourceBitmap = scaleBitmapImage; canvas.drawBitmap(sourceBitmap, new Rect(0, 0, sourceBitmap.getWidth(), sourceBitmap.getHeight()), new Rect(0, 0, targetWidth, targetHeight), null); return targetBitmap; }
我这样做是为了得到一个圆形的ImageView,我怎么能添加了一圈边框周围喜欢这幅画http://i.stack.imgur.com/x8PhM.pngAndroid的圆形边框圆形图像