private Bitmap renderDrawable(final Drawable drawable) {
if (drawable instanceof BitmapDrawable) {
return ((BitmapDrawable) drawable).getBitmap();
}
final Rect bounds = drawable.getBounds();
final Bitmap bitmap = Bitmap.createBitmap(
bounds.width(),
bounds.height(),
Bitmap.Config.ARGB_8888
);
final Canvas canvas = new Canvas(bitmap);
canvas.translate(-bounds.left, -bounds.top);
drawable.draw(canvas);
return bitmap;
}
ColorizedCardView.java 文件源码
java
阅读 43
收藏 0
点赞 0
评论 0
项目:Hands-On-Android-UI-Development
作者:
评论列表
文章目录