![](/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.