Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get size of Bitmap Android [duplicate]

Possible Duplicate:
Bitmap byte-size after decoding?

Is there anyway so I can get the size of this Bitmap?I've tried to use getByteCount() but I can't use it?

Bitmap bitmap = BitmapFactory.decodeByteArray(decryptedData , 0, decryptedData .length);    //decoding bytearrayoutputstream to bitmap

Any suggestions?

like image 710
hardartcore Avatar asked Jul 26 '11 17:07

hardartcore


1 Answers

As you can see from the API, you can use

getWidth()
getHeight()

for the size of the Bitmap in pixels.

And if it is an array of bytes (8bit = 1byte) then just take decryptedData.length - offset and you know how many bytes are in the Bitmap.

Or am I missing something here?

like image 126
das_weezul Avatar answered Oct 24 '22 18:10

das_weezul