Android asBitmap()在Glide中有什么用途?

Android asBitmap()在Glide中有什么用途?,android,android-glide,Android,Android Glide,有人能告诉我Glide中调用asBitmap()函数的时间、地点和原因吗 我目前正在使用Glide 3.8.0。asBitmap()用于在ImageView或其他视图中显示位图之前编辑、转换或装饰位图(因为不能将Glide与ImageView以外的其他视图一起使用) 类似于在setBackgroundDrawable(从位图创建)之前以位图形式获取图像作为LinearLayout的背景当您需要加载位图而不将其附加到图像视图时,请使用asBitmap()函数 例如: Glide.with(cont

有人能告诉我Glide中调用
asBitmap()
函数的时间、地点和原因吗

我目前正在使用Glide 3.8.0。

asBitmap()用于在ImageView或其他视图中显示位图之前编辑、转换或装饰位图(因为不能将Glide与ImageView以外的其他视图一起使用)

类似于在setBackgroundDrawable(从位图创建)之前以位图形式获取图像作为LinearLayout的背景

当您需要加载位图而不将其附加到
图像视图时,请使用
asBitmap()
函数

例如:

Glide.with(context)
            .load(image)
            .asBitmap()
            .into(new SimpleTarget<Bitmap>() {
                @Override
                public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {

                }
            });
Glide.with(上下文)
.加载(图像)
.asBitmap()
.into(新的SimpleTarget(){
@凌驾
public void onResourceReady(位图资源、动画)