+ [task127424] init image data of think3c widget.

This commit is contained in:
wangzemei
2024-09-04 03:27:22 +00:00
committed by qixinzhi
parent 891da2953f
commit 8b44ea3113
+15
View File
@@ -1,3 +1,18 @@
$(document).ready(function()
{
const canvas = $('#canvas')[0];
const ctx = canvas.getContext('2d');
const image = new Image();
const maxWidth = $('.think-model-content').width() || 500;
const maxHeight = maxWidth;
image.src = modelImg;
/* 检查图片是否已加载完成,如未完成,手动触发处理逻辑。*/
/* Check if the image has been loaded completely. If not, manually trigger the processing logic. */
if(image.complete && image.naturalWidth != 0) image.onload();
});
/**
* 将图像二值化。
* Binarize the image.