嗨,我正在从名为 .png 的 png 图像创建位图image.png
。图像的尺寸为 75(宽)x 92(高)。当我运行此代码时:
Bitmap bitmap = BitmapFactory.decodeResource(this.context.getResources(), R.drawable.image
Log.d("image", "height: " + bitmap.getHeight() + " width: " + bitmap.getWidth());
记录器日志:
DEBUG/image(3550): height: 138 width: 113
并且屏幕上的图像比其他尺寸为 75 x 92 的图像大。我该怎么做才能让 android 加载具有正确尺寸的图像?