1.Simple Target
拿到图片的BitMap对象,不直接加载至ImageView 中(Simple Target)
Glide into(),不仅可以传入ImageView 控件,还可传入 Targets
private SimpleTarget target = new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap bitmap, GlideAnimation glideAnimation) {
}
};
private void loadImageSimpleTarget() {
Glide
.with( context )
.load( eatFoodyImages[0] )
.asBitmap()
.into( target );
}
2.生成指定的图片大小。
private SimpleTarget target = new SimpleTarget<Bitmap>(250,250) {
@Override
public void onResourceReady(Bitmap bitmap, GlideAnimation glideAnimation) {
}
};
private void loadImageSimpleTarget() {
Glide
.with( context )
.load( eatFoodyImages[0] )
.asBitmap()
.into( target );
}