From 4dfe37664d291eed012654fc0937af9cc394d067 Mon Sep 17 00:00:00 2001 From: wangzemei Date: Thu, 5 Sep 2024 16:14:41 +0800 Subject: [PATCH] + [task#127424] add displayColoredImage function of think3c widget. --- lib/zin/wg/think3c/js/v1.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/zin/wg/think3c/js/v1.js b/lib/zin/wg/think3c/js/v1.js index 6d94c0b04e..a76030aeb2 100644 --- a/lib/zin/wg/think3c/js/v1.js +++ b/lib/zin/wg/think3c/js/v1.js @@ -226,3 +226,14 @@ function colorRegions(binaryImageData) }; }); } + + +function displayColoredImage(coloredImageData) +{ + const canvas = $('#canvas')[0]; + const ctx = canvas.getContext('2d'); + const img = new Image(); + + img.src = coloredImageData; + img.onload = function(){ctx.drawImage(img, 0, 0);}; +} \ No newline at end of file