【发布时间】:2019-11-22 15:00:34
【问题描述】:
我想获取我上传的图片的长度和宽度,它的base64是。 这是我的代码:
Image img = new Image();
img.src = Selectedimage.src;
Img.onload = function {
this.width = img.width;
this.height = img.height; }
问题是我无法通过 «this» 访问此类中的变量。 有人知道问题出在哪里,或者有其他方法吗?
【问题讨论】:
标签: html angular image typescript width