絵のターンbase64でソリューションを引っ張るために小さなマイクロチャネルプログラム

あなたはまだ保存されている画像を転送する方法小さなプログラムを見ているとこっち、見て来る、まあBASE64に表示されます。

9028759-0554813aedeb2c50.jpeg
微信

使用

JSファイル

let $this = this;
request({
      url:'https://www.dounine.com/hello.jpg',
      method:'GET',
      responseType: 'arraybuffer',
      success:function(res){
        let base64 = wx.arrayBufferToBase64(res);
        $this.data.userImageBase64 = 'data:image/jpg;base64,' + base64;;
      }
});

wxmlファイル

<image src='{{userImageBase64}}' style='width:90rpx;height:90rpx;' />

おすすめ

転載: blog.csdn.net/weixin_34242658/article/details/90840070