How to resize images at runtime for different screens?

笑着哭i 提交于 2019-12-01 12:58:45
Pavneet_Singh

there are two ways , either you do it or let other do it

  1. you can use picasso(image loading library ) with fit function and just relax .link

  2. find the required size and compress the image size with required parameter.android guide

there are couple of other library like picasso,glide,universal image loader and lot other though picasso and glide are most popular among android developers

Code Reference Links :

Picasso

Picasso library to download images

Resize image to full width and fixed height with Picasso

Glide

Load image from SD card using Glide

Pros of libs :

  • In-Build image downloading mechanism with other features like animation,re-sizing etc
  • In-Build cache mechanism
  • Optimized written code by experienced coders
  • Can load images to bitmap , from resources etc
  • Animation support

Cons :

  • Stay in touch with docs for new updates and more consistent features
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!