![](/img/trans.png)
[英]ngx-image-cropper - how change only the length or width of a cropper
[英]ngx-Image-Cropper: how to define width when loaded and before cropped
假设我有一个 6000 像素 x 4000 像素的巨大图像,我怎样才能让它在 my.html 中只占用 250 像素的宽度?
尝试以下不起作用:
<image-cropper width="50px"...>
<image-cropper [resizeToWidth]="250"...>
注意我不想预定义纵横比,我知道resizeToWidth
是用于裁剪后的。
跳出框框思考使用旧技巧,只需使用 a 包围cropper:
<div #cropContainer style="display: block; width: 100px"><image-cropper ...></div>
在stackblitz中试试这个例子
[resizeToWidth]="200"
应该可以。 再试一遍。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.