Where the heck is Bitmap getByteCount()?

后端 未结 7 2030
时光取名叫无心
时光取名叫无心 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:01

    As you can see in the source code, getByteCount is simply this:

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

    Here is the source code for 5.0

提交回复
热议问题