如何使用 android fresco 从动画 webp 获取所有位图?
How to get all bitmaps from animated webp using android fresco?
如何使用 android fresco 从 webp 动画中获取所有位图的列表?
下面的代码总是returns null 而不是位图
val imageRequest = ImageRequestBuilder
.newBuilderWithSource(Uri.parse("https://upload.wikimedia.org/wikipedia/commons/4/41/Sunflower_from_Silesia2.jpg"))
.build()
val imagePipeline = Fresco.getImagePipeline()
val dataSource = imagePipeline.fetchDecodedImage(imageRequest, this)
dataSource.subscribe(object : BaseBitmapDataSubscriber() {
override fun onFailureImpl(dataSource: DataSource<CloseableReference<CloseableImage>>?) {
val m = dataSource
}
override fun onNewResultImpl(bitmap: Bitmap?) {
val m = bitmap
}
}, CallerThreadExecutor.getInstance())
对于所有感兴趣的人,fresco 文档有这一行 "This subscriber doesn’t work for animated images as those can not be represented as a single bitmap."
如何使用 android fresco 从 webp 动画中获取所有位图的列表?
下面的代码总是returns null 而不是位图
val imageRequest = ImageRequestBuilder
.newBuilderWithSource(Uri.parse("https://upload.wikimedia.org/wikipedia/commons/4/41/Sunflower_from_Silesia2.jpg"))
.build()
val imagePipeline = Fresco.getImagePipeline()
val dataSource = imagePipeline.fetchDecodedImage(imageRequest, this)
dataSource.subscribe(object : BaseBitmapDataSubscriber() {
override fun onFailureImpl(dataSource: DataSource<CloseableReference<CloseableImage>>?) {
val m = dataSource
}
override fun onNewResultImpl(bitmap: Bitmap?) {
val m = bitmap
}
}, CallerThreadExecutor.getInstance())
对于所有感兴趣的人,fresco 文档有这一行 "This subscriber doesn’t work for animated images as those can not be represented as a single bitmap."