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();

 

Android中加载位图的方法,,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。