Create Circle Image in Android

To Create the Circe Image in Android add the following code: 
  1. Bitmap bm = BitmapFactory.decodeResource(getResources(),  
  2.               R.drawable.simple_image);  
Now Make A function like this,
 
To Create Circle Image. 
  1. private Bitmap getCircleBitmap(Bitmap bitmap) {  
  2.        final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),  
  3.                bitmap.getHeight(), Bitmap.Config.ARGB_8888);  
  4.        final Canvas canvas = new Canvas(output);  
  5.   
  6.        final int color = Color.RED;  
  7.        final Paint paint = new Paint();  
  8.        final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());  
  9.        final RectF rectF = new RectF(rect);  
  10.   
  11.        paint.setAntiAlias(true);  
  12.        canvas.drawARGB(0, 0, 0, 0);  
  13.        paint.setColor(color);  
  14.        canvas.drawOval(rectF, paint);  
  15.   
  16.        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));  
  17.        canvas.drawBitmap(bitmap, rect, rect, paint);  
  18.   
  19.        bitmap.recycle();  
  20.   
  21.        return output;  
  22.    }