4

如何从 ProfilePictureView 转换为位图?这是可能的?

4

2 回答 2

9

我懂了!!

ImageView fbImage = ( ( ImageView)profilePictureFB.getChildAt( 0));
Bitmap    bitmap  = ( ( BitmapDrawable) fbImage.getDrawable()).getBitmap();
于 2013-01-26T14:42:11.750 回答
1

您也可以只启用 ProfilePictureView 的 DrawingCache,然后调用 getDrawingCache... 像这样

 ProfilePictureView mImage = (ProfilePictureView) findViewById(R.id.profilepic);
 mImage.setDrawingCacheEnabled(true);
 mImage.setProfileId(user.getId());

然后在加载个人资料图片时...

 Bitmap bitmap = mImage.getDrawingCache();
于 2013-06-26T09:27:25.167 回答