|
@@ -55,7 +55,7 @@ Page({
|
|
},
|
|
},
|
|
src: '',
|
|
src: '',
|
|
showProgress: false,
|
|
showProgress: false,
|
|
- showCropImg: false,
|
|
|
|
|
|
+ showCropImg: true,
|
|
width: 250,//宽度
|
|
width: 250,//宽度
|
|
height: 250,//高度
|
|
height: 250,//高度
|
|
_imageBuffer: null,
|
|
_imageBuffer: null,
|
|
@@ -97,8 +97,14 @@ Page({
|
|
cropScale: '1:1', // 裁剪比例
|
|
cropScale: '1:1', // 裁剪比例
|
|
success(res) {
|
|
success(res) {
|
|
console.log("裁剪后的图片", res)
|
|
console.log("裁剪后的图片", res)
|
|
|
|
+ that.setData({
|
|
|
|
+ showCropImg: true,
|
|
|
|
+ topImg: { "pic": res.tempFilePath }
|
|
|
|
+ })
|
|
that.convertImageToRGB565(res.tempFilePath)
|
|
that.convertImageToRGB565(res.tempFilePath)
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
@@ -113,8 +119,8 @@ Page({
|
|
const ctx = wx.createCanvasContext('imageCanvas');
|
|
const ctx = wx.createCanvasContext('imageCanvas');
|
|
// const ctx = Canvas.getContext('imageCanvas');
|
|
// const ctx = Canvas.getContext('imageCanvas');
|
|
let _this = this;
|
|
let _this = this;
|
|
- let width = 400;
|
|
|
|
- let height = 400;
|
|
|
|
|
|
+ let width = 533;
|
|
|
|
+ let height = 533;
|
|
try {
|
|
try {
|
|
// 设置 Canvas 尺寸
|
|
// 设置 Canvas 尺寸
|
|
// _this.setData({ canvasWidth: width, canvasHeight: height });
|
|
// _this.setData({ canvasWidth: width, canvasHeight: height });
|
|
@@ -275,7 +281,7 @@ Page({
|
|
progress: 0,
|
|
progress: 0,
|
|
progressPercent: 0,
|
|
progressPercent: 0,
|
|
showProgress: false,
|
|
showProgress: false,
|
|
- showCropImg: false
|
|
|
|
|
|
+ // showCropImg: false
|
|
});
|
|
});
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '图片上传成功',
|
|
title: '图片上传成功',
|