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

Viewed 2714

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 see anything in the documentation about this. Only see this in the documentation

Throws

IllegalArgumentException if the width or height are <= 0

But while debugging in eclipse I see the width and height are -1 after creation. Everything seems to display correctly.

[Update]

If I add a Log and get the width and height

Log.i(logTag, "bmp - (width,height) (" + bmp.getWidth() + "," + bmp.getHeight() + ")");

Then look at the properties of the bitmap, the correct width and height are shown (I'm assuming any call to read the width and height after creation would then update the properties in eclipse and it will show correctly).

I guess this is just a debugger issue? I'm debugging on my old Droid.

1 Answers
Related