Replies: 1 comment 1 reply
-
|
image-restriction="stencil"改成 fit-area 试试呢? stencil 会随意缩放。 这个文档也折磨了我好久……先试参数,方法没示例完全不知道咋用,能不用的话还是别用了…… |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I'm struggling with my cropper configuration and would really appreciate some guidance.
My requirements:
image-restriction: 'stencil'My current code:
this is a very small image (much smaller than the 400px container). Currently, it gets automatically scaled up to fill the boundaries (similar to CSS background-size: cover), as shown below:

I want the small image to maintain its original size without being scaled up. The image should appear at its native resolution (1:1 pixel ratio) within the fixed container, like this:
Current behavior:
background-size: cover) - the shorter side fills the boundaries completelyExpected behavior:
I've read through the docs but I'm not sure which approach would work best here. Should I customize
defaultVisibleArea,defaultBoundaries, or maybe theinitStretcheralgorithm? Any help or guidance would be greatly appreciated. Thanks in advance!Chinese
大家好,我在配置裁剪器时遇到了一些困难,希望能得到一些指导。
我的需求:
image-restriction: 'stencil'我当前的代码:
当前行为:
background-size: cover) - 短边完全填充边界期望行为:
我已经阅读了文档,但不太确定哪种方法最合适。我应该自定义
defaultVisibleArea、defaultBoundaries,还是initStretcher算法?非常感谢任何帮助和指导!Beta Was this translation helpful? Give feedback.
All reactions