Android中加载位图的方法

Android中加载位图的关键的代码:

   AssetManager assets =context.getAssets(); //用一个AssetManager 对象来从应用程序包的已编译资源中为工程加载资产

  InputStream istream=assets.open("/*位图的名字*/");

BitmapFactory.Options options=new BitmapFactory.Options();

options.inPreferredConfig =Bitmap.Config.ARGB_8888 //设置为32位图像格式

Bitmap bitmap=BitmapFactory.decodeStream(istream.null.options);

istream.close();

原文地址:https://www.cnblogs.com/WoodJim/p/3731544.html