图上为开发者工具上生成的图片。
图上为iphone6sp 生成的图片,头像变成方的了。
以下为代码,麻烦官方帮忙看下是什么问题。
canvas: function () {
var that = this
var context = wx.createCanvasContext(‘ass’)
var avatarurl_widths = 150;
var avatarurl_heigths = 150;
var avatarurl_xs = that.data.width * 0.5 - 75;
var avatarurl_ys = that.data.height * 0.63;
var avatarurl_width = 70;
var avatarurl_heigth = 70;
var avatarurl_x = that.data.width * 0.5-35;
var avatarurl_y = 5;
context.drawImage(that.data.downbj, 0, 0, that.data.width, that.data.height);
context.setTextAlign(‘center’)
context.setFontSize(20)
context.setFillStyle(’#fd943f’)
context.fillText(‘用’ + that.data.shopname, that.data.width * 0.5, 110)
context.save();
context.beginPath();
context.arc(avatarurl_widths / 2 + avatarurl_xs, avatarurl_heigths / 2 + avatarurl_ys, avatarurl_widths / 2, 0, Math.PI * 2, false);
context.clip();
context.drawImage(that.data.downimage, avatarurl_xs, avatarurl_ys, avatarurl_widths, avatarurl_heigths);
context.restore();
context.arc(avatarurl_width / 2 + avatarurl_x, avatarurl_heigth / 2 + avatarurl_y, avatarurl_width / 2, 0, Math.PI * 2, false);
context.clip();
context.drawImage(that.data.downpt, avatarurl_x, avatarurl_y, avatarurl_width, avatarurl_heigth);
context.restore();
context.draw();
context.stroke()
},