private static Bitmap readBitmap(Context paramContext, String paramString)
{
int i = paramContext.getResources().getIdentifier(paramString, "drawable", paramContext.getPackageName());
BitmapFactory.Options localOptions = new BitmapFactory.Options();
localOptions.inScaled = false;
localOptions.inPreferredConfig = Bitmap.Config.RGB_565;
Bitmap localBitmap1;
try
{
Bitmap localBitmap2 = BitmapFactory.decodeResource(paramContext.getResources(), i, localOptions);
localBitmap1 = localBitmap2;
}
catch (Exception localException)
{
localBitmap1 = BitmapFactory.decodeResource(paramContext.getResources(), i);
}
return localBitmap1;
}
Android 通过图片名字生成bitmap
最新推荐文章于 2024-06-19 04:41:37 发布