如何将HttpResponse <inputstream>转换为位图格式?

时间:2017-10-26 20:11:35

标签: java android mobile bitmap inputstream

我正在尝试转换HttpResponse<InputStream>(QR码) 到一个Bitmap对象。我怎么能这样做?

HttpResponse<InputStream> response =
    Unirest.get("https://unitag-qr-code-generation.p.mashape.com/api?data="+data+"setting="+set)
           .header("X-Mashape-Key", "MY KEY")
           .asBinary();

Bitmap image = BitmapFactory.decodeStream(response);

0 个答案:

没有答案