imageload封装类
来源:互联网 发布:php个人博客网站模板 编辑:程序博客网 时间:2024/06/05 02:23
public static void initImageLoader(Context context){ File cacheFile=context.getExternalCacheDir();//android认为的缓存目录 ImageLoaderConfiguration configuration=new ImageLoaderConfiguration.Builder(context) .memoryCacheExtraOptions(480, 800)//缓存图片最大的长和宽 .threadPoolSize(2)//线程池的数量 .threadPriority(4) .memoryCacheSize(2*1024*1024)//设置内存缓存区大小 .diskCacheSize(20*1024*1024)//设置sd卡缓存区大小 .diskCache(new UnlimitedDiscCache(cacheFile))//自定义缓存目录 .writeDebugLogs()//打印日志内容 .diskCacheFileNameGenerator(new Md5FileNameGenerator())//给缓存的文件名进行md5加密处理 .build(); ImageLoader.getInstance().init(configuration);}/** * 得到图片的显示设置类 * @return */public static DisplayImageOptions getImageOptions(){ DisplayImageOptions options=new DisplayImageOptions.Builder() .cacheInMemory(true)//使用内存缓存 .cacheOnDisk(true)//使用磁盘缓存 .bitmapConfig(Bitmap.Config.RGB_565)//设置图片的色彩模式 .imageScaleType(ImageScaleType.EXACTLY)//设置图片的缩放方式 .build(); return options;}
阅读全文
0 0
- imageload封装类
- ImageLoad
- ImageLoad
- imageload
- 最简单圆形图片和头像(重新封装ImageLoad)-巧用universal-image-loader
- imageload 知识
- ImageLoad(一)
- ImageLoad(二)
- ImageLoad总结
- 微软的ImageLoad
- ImageLoad图片加载器
- imageload如何更改文件名
- ImageLoad中的配置属性
- 使用imageload加载图片
- 开源imageload的使用
- imageload的简单实用
- kaoshi(imageload接口)
- imageload缓存图片
- PHP+MYSQL中使用PDO中执行SQL语句
- HighCharts入门教程
- 聚合支付态度支付,满足各类支付场景需求
- 递归
- PHP+MYSQL中使用PDO获取结果集的fetch方法
- imageload封装类
- PHP+MYSQL中使用PDO的query方法
- eclipse 工程感叹号处理
- 4.Python入门之元组,字符串
- PHP+MYSQL中使用PDO获取结果集的fetchAll方法
- ros机器人问题总结篇(1)
- LeetCode||65. Valid Number
- 一脸懵逼学习Linux的Shell编程
- could not open the spreadsheet