小编Mar*_*son的帖子

使用filereader获取图像的宽度和高度

我正在构建一个图像调整大小/裁剪,我想在他们用模态(bootstrap)编辑它之后显示一个实时预览.我相信这应该可行,但我在console.log中得到0.这需要将原始图像的宽度和高度输入另一个脚本(我将在之后执行,现在只需要它们在console.log /变量中)

function doProfilePictureChangeEdit(e) {
    var files = document.getElementById('fileupload').files[0];
    var reader = new FileReader();
    reader.onload = (function(theFile) {
        document.getElementById('imgresizepreview').src = theFile.target.result;

        document.getElementById('profilepicturepreview').src = theFile.target.result;
      }
    );
    reader.readAsDataURL(files);
    var imagepreview = document.getElementById('imgresizepreview');
    console.log(imagepreview.offsetWidth);
    $('img#imgresizepreview').imgAreaSelect({
        handles: true,
        enable: true,
        aspectRatio: "1:1",
        onSelectEnd: preview
    });
    $('#resizeprofilepicturemodal').modal('show');
    };
Run Code Online (Sandbox Code Playgroud)

javascript dom filereader

39
推荐指数
2
解决办法
5万
查看次数

Visual Studio Mac无法运行ASP.NET核心项目

事后看来,这可能非常明显.安装新的VS Mac并创建ASPNET Core项目时,我无法通过单击左上角的运行按钮来运行它.

如果我右键单击Web项目,单击"Run With",然后单击"Custom Configuration",我就可以运行.效果很好.

但是,运行项目已禁用,我无法想出任何启用它的方法:http://prntscr.com/f7rsgh

visual-studio-mac

7
推荐指数
1
解决办法
926
查看次数

标签 统计

dom ×1

filereader ×1

javascript ×1

visual-studio-mac ×1