Android Bitmap.createBitmap() returning a bitmap with -1 for height and width

前端 未结 1 878
天涯浪人
天涯浪人 2021-01-17 21:33

Why would

Bitmap bmp;
bmp = Bitmap.createBitmap( 100, 100, Config.RGB_565 );

Ever return a bitmap with a height and width of -1? I don\'t

相关标签:
1条回答
  • 2021-01-17 22:03

    Are you in a situation where this is an issue? Or merely curious why they are -1?

    Either way it is not a debugger issue, the properties are actually -1. This is just speculation but until the Bitmap is used/drawn the width and height can be -1 because it doesn't matter and is likely an optimization in the implementation.

    0 讨论(0)
提交回复
热议问题