+ [task127424] init image data of think3c widget.
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user