Android: how to convert whole ImageView to Bitmap?

来源:互联网 发布:linux中iconv命令 编辑:程序博客网 时间:2024/06/06 09:05
http://stackoverflow.com/questions/4715044/android-how-to-convert-whole-imageview-to-bitmap
1:
BitmapDrawable drawable = (BitmapDrawable) imageView.getDrawable();Bitmap bitmap = drawable.getBitmap()
2:
11down voteaccepted

You could just use the imageView's image cache. It will render the entire view as it is layed out (scaled,bordered with a background etc) to a new bitmap.

just make sure it built.

imageView.buildDrawingCache();Bitmap bmap = imageView.getDrawingCache();

原创粉丝点击