您的位置:首页 > 其它

Fresco 获得Bitmap

2015-07-14 14:23 267 查看
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());
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: