Guest User

Untitled

a guest
May 28th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. // v3以前
  2. Glide.with(context)
  3. .loadFromMediaStore(localMedia.getLocalPath())
  4. .asBitmap()
  5. .imageDecoder(new StreamBitmapDecoder(
  6. Downsampler.AT_LEAST,
  7. Glide.get(mContext).getBitmapPool(),
  8. DecodeFormat.PREFER_ARGB_8888
  9. ))
  10. .into(imageView);
  11.  
  12. // v4以降
  13. // optionオブジェクトを構築して…
  14. RequestOptions options = new RequestOptions()
  15. .format(DecodeFormat.PREFER_ARGB_8888)
  16. .downsample(DownsampleStrategy.AT_LEAST);
  17. // applyでoptionsをset
  18. GlideApp.with(context)
  19. .asBitmap()
  20. .load(uri)
  21. .apply(options)
  22. .into(imageView);
Add Comment
Please, Sign In to add comment