Reputation: 233
I'm just wondering if what is the best way to use BitmapFactory
? I'm confuse about the decodestream and decodesource. On that two which is the best one to use? I saw some code that uses bitmap decoderesource and some decodestream of many android programmers and developers here which is the best way to use?
Upvotes: 0
Views: 117
Reputation: 786
There is no real "best way" to use the BitmapFactory. It provides utilities that are situationally beneficial.
If you are pulling a bitmap from the web, you may have an input stream providing the bitmap data. Alternatively, you may open an InputStream to the file system if you have an image on disk. In either case, you may want to use the decodeStream call.
You can use decodeResource to decode a bitmap from one of your res folders, such as the drawable folders or the raw folder, which at times may also be useful.
Upvotes: 2