0

I'm using picasso library to download images from URL.What I need is just download the stream not a bitmap, but there is no such method in it.Is it true?

There is :

Picasso.with(this).load(URL_LONG).get(); // return bitmap

Sometimes there are some large images from URL.I need to handle them before displaying for avoiding out of memory.So I cannot load them into bitmap immediately.This is the reason i need the stream.

chenupt
  • 1,781
  • 1
  • 14
  • 13

1 Answers1

0

There is already a feature to provide what you need in Picasso Library. You can actually scale the image when you stream it. Check out this SOF Question.

Community
  • 1
  • 1
osayilgan
  • 5,873
  • 7
  • 47
  • 68
  • Tks.Does use fit() method? It cannot display when I try to load a large image.If I use resize method, how can I know its real height? – chenupt Oct 24 '14 at 02:26
  • It's actually in the question. You can give certain width and height values to your images. But If you want to have more control on bitmap, check out this answer. You can use Transformation. http://stackoverflow.com/a/22009875/1080954 – osayilgan Oct 24 '14 at 02:32