Fresco&Glide图片库缩放处理

Fresco添加缩放支持


1. 添加gradle依赖

compile('com.facebook.fresco:fresco:1.0.0') {

excludemodule:'support-v4',group:'com.android.support'

}

// 配置fresco使用okhttp3发起网络请求

compile('com.facebook.fresco:imagepipeline-okhttp3:1.0.0') {

excludemodule:'okhttp',group:'com.squareup.okhttp3'

}

// 实现缩放效果

compile'com.autonavi.gxdtaojin:lib-cview-photodraweeview:1.0.0'

2. 用PhotoDraweeView替换fresco默认的SimpleDraweeView

mPhotoDraweeView.setPhotoUri(Uri.parse("http://your.image.url"));

3. 参考:

https://github.com/ongakuer/PhotoDraweeView

https://github.com/chrisbanes/PhotoView

https://www.fresco-cn.org/

Glide添加缩放支持


1. 添加gradle支持

// https://mvnrepository.com/artifact/com.github.bumptech.glide/glide

compilegroup:'com.github.bumptech.glide',name:'glide',version:'3.7.0'

// https://mvnrepository.com/artifact/com.github.chrisbanes.photoview/library

providedgroup:'com.github.chrisbanes.photoview',name:'library',version:'1.2.4'

2. 使用方法

首先通过glide给imageview设置bitmap,然后

3. 参考资料

https://github.com/chrisbanes/PhotoView

https://mrfu.me/2016/02/27/Glide_Getting_Started/

https://github.com/bumptech/glide

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 框架:提供一定能力的小段程序 http://www.cnblogs.com/jincheng-yangchaofa...
    姑娘请别为难小僧阅读 12,093评论 0 132
  • 一.榜单介绍 排行榜包括四大类: 单一框架:仅提供路由、网络层、UI层、通信层或其他单一功能的框架 混合开发框架:...
    伟子男阅读 10,610评论 0 161
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,650评论 2 45
  • 附上原文作者连接:作者:金诚 一.榜单介绍 排行榜包括四大类: 单一框架:仅提供路由、网络层、UI层、通信层或其他...
    这个美嘉不姓陈阅读 6,687评论 1 35
  • 他只是欧洲核子研究组织里面最普通的一员,他甚至不是物理学家。他每天乘坐电梯来到百米深的地底,总是很自豪地想,他的工...
    letsfly阅读 2,087评论 0 3