I have an icon with 48x48 dimension. And I put it under the drawable-mdpi
folder.
Then I tried to get its size:
BitmapDrawable bd = (BitmapDrawable) context.getResources().getDrawable(R.drawable.ic);
Bitmap bm = bd.getBitmap();
Log.d("render", "icon height:" + bm.getHeight());
canvas.drawBitmap(bd.getBitmap(), 0, 0, p);
From the logcat, it prints: icon height: 72
.
Then I put the icon under drawable-hdpi
, then I got: icon height: 48
.
Then I put the icon under drawable-ldpi
, then I got: icon height: 96
.
What is going on?