//第一種
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.head);
RoundedBitmapDrawable drawable = RoundedBitmapDrawableFactory.create(getResources(),bitmap);
drawable.setCircular(true);?
//第二種
Bitmapbitmap = BitmapFactory.decodeResource(getResources(),R.drawable.head);
?BitmapShader bitmapShader =newBitmapShader(bitmap,Shader.TileMode.CLAMP,Shader.TileMode.CLAMP);
?Paint paint =newPaint();
?paint.setShader(bitmapShader);canvas.drawCircle(500,250,200,paint);?
canvas.drawCircle(500,250,200,paint);?