美文网首页
使用Picasso框架把网络图片转换成Bitmap

使用Picasso框架把网络图片转换成Bitmap

作者: 伪装的狼 | 来源:发表于2020-02-07 01:06 被阅读0次

    try {
    Bitmap bitmap = Picasso.with(context).load(song.getImage()).get();
    } catch (IOException e) {
    e.printStackTrace();
    }

    其他办法:
    URL url = new URL("http://qpic.y.qq.com/music_cover/8eiaDBJ27yYicpMibYZmmEdNGjF1cicV65ic11PNenswv6nfdNKBo5r4LVg/300?n=1");
    InputStream is = url.openStream();
    Bitmap bitmap = BitmapFactory.decodeStream(is);
    is.close();

    使用以上代码即可!

    相关文章

      网友评论

          本文标题:使用Picasso框架把网络图片转换成Bitmap

          本文链接:https://www.haomeiwen.com/subject/xubpxhtx.html