From e413ffddcca924865f6312752ffa3c95e1150470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=91=A8=E9=83=A8=E8=90=BD?= Date: Sun, 15 Aug 2021 21:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=8F=90=E9=AB=98=20HTML5?= =?UTF-8?q?=20=E5=A4=B4=E5=83=8F=E4=B8=8A=E4=BC=A0=E7=9A=84=E6=B8=85?= =?UTF-8?q?=E6=99=B0=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/static/avatar/avatar.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/upload/static/avatar/avatar.js b/upload/static/avatar/avatar.js index c285660df..adc407ffe 100644 --- a/upload/static/avatar/avatar.js +++ b/upload/static/avatar/avatar.js @@ -128,6 +128,7 @@ function refreshAvatarCanvas(uiposition) { var iw = jQuery('#avatarimage').width(); var ih = jQuery('#avatarimage').height(); var img = $('avatarimage'); + ctx.imageSmoothingQuality = 'high'; ctx.drawImage(img, 0,0, iw, ih, ad.left, ad.top, ad.width, ad.height); var sd = getSelectorDimention(); if (uiposition) { @@ -189,6 +190,7 @@ function saveAvatar() { var ctx = canvas.getContext("2d"); ctx.fillStyle = 'white'; ctx.fillRect(0, 0, tw, th); + ctx.imageSmoothingQuality = 'high'; ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); var dataURL = canvas.toDataURL("image/jpeg"); jQuery('#avatar1').val(dataURL.substr(dataURL.indexOf(",") + 1)); @@ -206,6 +208,7 @@ function saveAvatar() { var ctx = canvas.getContext("2d"); ctx.fillStyle = 'white'; ctx.fillRect(0, 0, tw, th); + ctx.imageSmoothingQuality = 'high'; ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); var dataURL = canvas.toDataURL("image/jpeg"); jQuery('#avatar2').val(dataURL.substr(dataURL.indexOf(",") + 1)); @@ -227,6 +230,7 @@ function saveAvatar() { var ctx = canvas.getContext("2d"); ctx.fillStyle = 'white'; ctx.fillRect(0, 0, tw, th); + ctx.imageSmoothingQuality = 'high'; ctx.drawImage(img, sl, st, sw, sh, 0, 0, tw, th); var dataURL = canvas.toDataURL("image/jpeg"); jQuery('#avatar3').val(dataURL.substr(dataURL.indexOf(",") + 1)); @@ -261,6 +265,7 @@ function refreshAvatarCanvasForDisplay() { } var ctl = 10; var ctt = 10; + ctx.imageSmoothingQuality = 'high'; ctx.drawImage(img, sl, st, sw, sh, ctl, ctt, tw, th); ctl += 20 + tw; -- Gitee