码迷,mamicode.com
首页 > 其他好文 > 详细

Fresco 获得Bitmap

时间:2015-07-14 15:20:17      阅读:682      评论:0      收藏:0      [点我收藏+]

标签:

ImageRequest imageRequest = ImageRequestBuilder
                            .newBuilderWithSource( Uri.parse(getFeedItem(position).feedImageUrl.get(index)))
                            .setProgressiveRenderingEnabled(true)
                            .build();

ImagePipeline imagePipeline = Fresco.getImagePipeline();
DataSource<CloseableReference<CloseableImage>>
                                    dataSource = imagePipeline.fetchDecodedImage(imageRequest,mContext);

 dataSource.subscribe(new BaseBitmapDataSubscriber() {

                                     @Override
                                     public void onNewResultImpl(@Nullable Bitmap bitmap) {
                                     // You can use the bitmap in only limited ways
                                     // No need to do any cleanup.

                                     }

                                     @Override
                                     public void onFailureImpl(DataSource dataSource) {
                                     // No cleanup required here.
                                            }
                                   },
                                    CallerThreadExecutor.getInstance());

Fresco 获得Bitmap

标签:

原文地址:http://www.cnblogs.com/zlfoak/p/4645322.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!