Where the heck is Bitmap getByteCount()?

后端 未结 7 2025
时光取名叫无心
时光取名叫无心 2021-01-02 05:46

I know the Android platform is a huge mess, over complicated and over-engineered, but seriously to get the size of a bitmap, is it really necessary to do all those conversio

7条回答
  •  孤独总比滥情好
    2021-01-02 06:03

    Before API 12 you can calculate the byte size of an Bitmap using getHeight() * getWidth() * 4 if you are using ARGB_8888 because every pixel is stored in 4bytes. I think this is the default format.

提交回复
热议问题