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

[建议] 关于图片裁剪 #32

Open
ouyoungs opened this issue Apr 2, 2024 · 4 comments
Open

[建议] 关于图片裁剪 #32

ouyoungs opened this issue Apr 2, 2024 · 4 comments

Comments

@ouyoungs
Copy link

ouyoungs commented Apr 2, 2024

现在的图片裁剪是直接裁剪长宽,如何让任意的形状路径裁剪图片呢。

比如让一个图片放到一个三角形里面、一个半圆里面。
Snipaste_2024-04-02_11-44-24

Snipaste_2024-04-02_11-45-26

@sleepy-zone
Copy link
Owner

我这里使用了一种简化的方式,外部使用现成的库裁剪。

理想的方式是使用 image + clipPath 实现,这样就能做到任意形状的裁剪了。

@sleepy-zone
Copy link
Owner

image

@ouyoungs
Copy link
Author

ouyoungs commented Apr 2, 2024

效率这么高嘛 !!!!!

@sleepy-zone
Copy link
Owner

没有😅,我截了一个别人的demo

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