Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何对图片进行裁剪 #463

Open
Xmtd opened this issue Jan 21, 2025 · 1 comment
Open

如何对图片进行裁剪 #463

Xmtd opened this issue Jan 21, 2025 · 1 comment

Comments

@Xmtd
Copy link

Xmtd commented Jan 21, 2025

现有一个需求,图片需要根据槽位的宽高比进行适配,当图片宽高比大于槽位宽高比的情况,高度占满槽位,宽度截断,实现这个有什么好的建议?

@drawcall
Copy link
Member

参考https://github.com/drawcall/inkpaint/blob/23295ab2dd802f976005242d369079d681d24b25/examples/source/js/demos-advanced/scratchcard.js#L35

使用mask呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants