Is there a way to load image as bitmap to Glide

后端 未结 11 1450
温柔的废话
温柔的废话 2020-12-04 19:35

Im looking for a way to use bitmap as input to Glide. I am even not sure if its possible. It\'s for resizing purposes. Glide has a good image enhancement with scale. The pro

11条回答
  •  Happy的楠姐
    2020-12-04 19:58

    here's another solution which return you a bitmap to set into your ImageView

    Glide.with(this)
                .load(R.drawable.card_front)    // you can pass url too
                .asBitmap()
                .into(new SimpleTarget() {
                    @Override
                    public void onResourceReady(Bitmap resource, GlideAnimation glideAnimation) {
                        // you can do something with loaded bitmap here
    
                        imgView.setImageBitmap(resource);
                    }
                });
    

提交回复
热议问题