[android-developers] get bitmap size

2012-09-19 Thread Live Happy
what is the best way to get the size of bitmap image i know there is
myBitmap.getByteCount() but this method is for api level 12 so it is there
any other way to get it thx on advance

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] get bitmap size

2012-09-19 Thread Przemyslaw Wegrzyn

On 2012-09-19 08:34, Live Happy wrote:
what is the best way to get the size of bitmap image i know there is 
myBitmap.getByteCount() but this method is for api level 12 so it is 
there any other way to get it thx on advance
You can use the following instead: myBitmap.getRowBytes() * 
myBitmap.getHeight()


Both methods available in API Level 1 already. And this is exactly what 
getByteCound() does internally.


BR,
Przemek


--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] get bitmap size

2012-09-19 Thread Live Happy
i already use this way but it is not give the real size its depend of
quality of image

On Wed, Sep 19, 2012 at 1:53 PM, Przemyslaw Wegrzyn
codepaint...@gmail.comwrote:

 On 2012-09-19 08:34, Live Happy wrote:

 what is the best way to get the size of bitmap image i know there is
 myBitmap.getByteCount() but this method is for api level 12 so it is there
 any other way to get it thx on advance

 You can use the following instead: myBitmap.getRowBytes() *
 myBitmap.getHeight()

 Both methods available in API Level 1 already. And this is exactly what
 getByteCound() does internally.

 BR,
 Przemek


 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-developers@**googlegroups.comandroid-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] get bitmap size

2012-09-19 Thread bob
What api level are you devving for?

Also, I would think *myBitmap.getRowBytes() * myBitmap.getHeight()* should 
work.

This is the Android source ( 4.1.1_r1 ):

*874 public final int getByteCount() {*
*875 // int result permits bitmaps up to 46,340 x 46,340*
*876 return getRowBytes() * getHeight();*
*877 }*

You could probably use Reflection and get the size of the byte array if you 
really need to, which I doubt.



On Wednesday, September 19, 2012 6:23:29 AM UTC-5, Live Happy wrote:

 i already use this way but it is not give the real size its depend of 
 quality of image

 On Wed, Sep 19, 2012 at 1:53 PM, Przemyslaw Wegrzyn 
 codepa...@gmail.comjavascript:
  wrote:

 On 2012-09-19 08:34, Live Happy wrote:

 what is the best way to get the size of bitmap image i know there is 
 myBitmap.getByteCount() but this method is for api level 12 so it is there 
 any other way to get it thx on advance

 You can use the following instead: myBitmap.getRowBytes() * 
 myBitmap.getHeight()

 Both methods available in API Level 1 already. And this is exactly what 
 getByteCound() does internally.

 BR,
 Przemek


 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-d...@**googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en




-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en