ProfilePictureView for Bitmap (Facebook SDK for Android v3)

How can I convert from ProfilePictureView to Bitmap? Is it possible?

+3


source to share


2 answers


I have it!



ImageView fbImage = ( ( ImageView)profilePictureFB.getChildAt( 0));
Bitmap    bitmap  = ( ( BitmapDrawable) fbImage.getDrawable()).getBitmap();

      

+8


source


You can also just include the DrawingCache ProfilePictureView and then call getDrawingCache ... like this

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

      



and then when loading the profile picture ...

 Bitmap bitmap = mImage.getDrawingCache();

      

+1


source







All Articles