【发布时间】:2011-04-03 20:02:53
【问题描述】:
我将图像拖到 Eclipse 中的 drawable-hdpi 文件夹中,当我将它们加载到程序中时,它们是原始大小的 2/3。 (我的 500x150 .png 被加载为 333x100 .png) 关于我应该如何为 android 创建/加载图像的任何建议?
private Bitmap mGrass;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
mGrass = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.grass, options);
canvas.drawBitmap(mGrass, 0, 0, noPaint);
【问题讨论】: