如何将Viewpager图像转换为位图
val img = adapter.currentItem //return an int data type.
答案 0 :(得分:0)
您也可以使用Glide获取imageview的位图,示例为
Glide.with(this)
.asBitmap()
.load(yourURL)
.into(object : CustomTarget<Bitmap>(){
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) {
// you can use the bitmap here
}
override fun onLoadCleared(placeholder: Drawable?) {
}
})