public Bitmap getFotoBitmap(Context context) {
Bitmap image;
if (this.foto != null) {
image = BitmapFactory.decodeByteArray(this.foto, 0, this.foto.length);
} else {
image = BitmapFactory.decodeResource(context.getResources(), R.drawable.pessoa_foto_default);
}
Bitmap imageRounded = Bitmap.createBitmap(image.getWidth(), image.getHeight(), image.getConfig());
Canvas canvas = new Canvas(imageRounded);
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setShader(new BitmapShader(image, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
canvas.drawRoundRect((new RectF(0, 0, image.getWidth(), image.getHeight())), image.getWidth() / 2, image.getWidth() / 2, paint);// Round Image Corner 100 100 100 100
return imageRounded;
}
Pessoa.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:app_secompufscar
作者:
评论列表
文章目录