开发者

Efficient retrieval of scaled asset bitmaps

I've got a GridView of many images which are retrieved from the assets folder and decoded from streams. These are t开发者_JS百科ypically quite large (to be used elsewhere in the app), but for the GridView need to only be 140dp wide or have a minimum height of 150dp. Which of the options in BitmapFactory.Options should I use to scale the image to this density/resolution? I'm confused by the many different density options.


For fast retrieval, you should use inSampleSize. It automatically loads a smaller bitmap without first loading the full image into memory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜