Render blob image with Angular 4

后端 未结 3 657
我寻月下人不归
我寻月下人不归 2021-01-22 21:19

I\'m trying to render an user image that comes from soap server response, it not should be difficult but i dont know how start to do.

This is the code of the request way

3条回答
  •  心在旅途
    2021-01-22 22:12

    I'm not an image converting expert, but if it's a binary encoded image, try this :

    let img = document.createElement('img');
    img.src = 'data:image/jpeg;base64,' + btoa('your binary data here');
    // image now contains your picture
    

    But I'm not sure this is correct data ... Anyways, try this, and let me know the result

提交回复
热议问题