项目作者: open-android

项目描述 :
结合Picasso使用,实现各种很炫的图片特效
高级语言: Java
项目地址: git://github.com/open-android/Picasso-transformations.git
创建时间: 2017-01-17T09:42:45Z
项目社区:https://github.com/open-android/Picasso-transformations

开源协议:Apache License 2.0

下载


结合Picasso实现很炫的图片效果框架

开源项目地址:https://github.com/open-android/Picasso-transformations

PS:如果觉得文章太长,你也可观看该课程的视频,亲,里面还有高清,无码的福利喔

运行效果

  • 爱生活,爱学习,更爱做代码的搬运工,分类查找更方便请下载黑马助手app

黑马助手.png

使用步骤

1. 在project的build.gradle添加如下代码(如下图)

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url "https://jitpack.io" }
  5. }
  6. }

2. 在Module的build.gradle添加依赖

  1. compile 'com.github.open-android:Picasso-transformations:0.1.0'

3. 使用Picasso加载图片时添加显示效果

  1. Picasso.with(context)
  2. .load(url)
  3. .transform(new CropCircleTransformation())//图片最终会展示出圆形区域
  4. .into(view);
  5. Picasso-transformations 是通过Picasso加载图片中通过上面的transform可以设置图片展示的效果 CropCircleTransformation是圆形效果,还有很多其他的效果
  6. 模糊效果
  7. Picasso.with(this)
  8. .load(R.mipmap.ic_image_sample)
  9. .bitmapTransform(new BlurTransformation(this))
  10. .into(mResultIv);
  11. 圆角效果
  12. Picasso.with(this).load(R.mipmap.ic_image_sample)
  13. .bitmapTransform(new RoundedCornersTransformation(this, 24, 0,
  14. RoundedCornersTransformation.CornerType.ALL))
  15. .into(mResultIv);
  16. 遮盖效果
  17. Picasso.with(this).load(R.mipmap.ic_image_sample)
  18. .bitmapTransform(new MaskTransformation(this, R.mipmap.ic_launcher))
  19. .into(mResultIv);
  20. 灰度效果
  21. Picasso.with(this).load(R.mipmap.ic_image_sample)
  22. .bitmapTransform(new GrayscaleTransformation(this))
  23. .into(mResultIv);
  24. 其他效果
  25. ToonFilterTransformation
  26. SepiaFilterTransformation
  27. ContrastFilterTransformation
  28. InvertFilterTransformation
  29. PixelationFilterTransformation
  30. SketchFilterTransformation
  31. SwirlFilterTransformation
  32. BrightnessFilterTransformation
  33. KuwaharaFilterTransformation
  34. VignetteFilterTransformation
  • 详细的使用方法在DEMO里面都演示啦,如果你觉得这个库还不错,请赏我一颗star吧~~~

  • 欢迎关注微信公众号