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

非裁切场景或裁切后对图片进行笔迹标注 #1220

Open
BugIsNull4396 opened this issue Jan 5, 2025 · 0 comments
Open

非裁切场景或裁切后对图片进行笔迹标注 #1220

BugIsNull4396 opened this issue Jan 5, 2025 · 0 comments

Comments

@BugIsNull4396
Copy link

开发者您好,我在一个图片处理场景中,需要对图片本身进行自定义笔迹标注。

我使用了cropper-image的自定义插槽,在插槽中渲染canvas,canvas中有我绘制的路径。当启用画笔时,我会禁用cropperjs本身的move功能,保持图片不动。

想要的功能:画笔状态下,鼠标左键按下持续绘制路径到插槽中的canvas上,用以标注图片,松开则停止绘制;单机右键时,取消画笔状态,这符合用户操作习惯。但是cropperjs本身阻止了鼠标左键按下以及移动、松开事件。我无法使用左键实现这一效果,目前右键事件不受影响,但右键绘制不符合 用户习惯。

请问能否通过属性或其他更好的方式放开事件拦截,以便我进行左键功能扩展,万分感谢。如果组件本身能够支持图片标注,那就更好了。

个人能力有限,请各位大佬批评指正,指点迷津。

下图为半成品,红色笔迹是我通过插槽中的canvas渲染的,不是手动录制。
image

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

1 participant