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

About the Draw a polygon when cropping #321

Open
AlbertLiu1974 opened this issue Apr 10, 2024 · 6 comments
Open

About the Draw a polygon when cropping #321

AlbertLiu1974 opened this issue Apr 10, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@AlbertLiu1974
Copy link

Hello,

I am writing some object detection on image loading via blazor WASM. Just want to know if we can use some other drawing functions like polygons, lines or arrows.. Kindly refer to the image or YT I recorded. thanks.

image

https://youtu.be/xOmG31Nv-Ew

Best regards,
Albert Liu

@MaxymGorn
Copy link
Member

MaxymGorn commented Apr 10, 2024

Hi @AlbertLiu1974.

Sorry, in this library draw functions is absent. But, you can crop a polygon image
image

Sincerely,
Maksym Hornytskiy

@MaxymGorn
Copy link
Member

MaxymGorn commented Apr 10, 2024

@AlbertLiu1974 Try to find some additional library for draw functionality, I did a quick search and found this: https://trevormare.github.io/STDoodle/help/doodledraw, maybe there is something else...

@MaxymGorn
Copy link
Member

@AlbertLiu1974 Also, I know you can also use "fabric.js" for the drawing function, but you need to find a library for that or wrap the blazor interop module js library

@MaxymGorn MaxymGorn self-assigned this Apr 10, 2024
@MaxymGorn MaxymGorn added help wanted Extra attention is needed question Further information is requested labels Apr 10, 2024
@MaxymGorn MaxymGorn closed this as not planned Won't fix, can't repro, duplicate, stale Apr 11, 2024
@MaxymGorn MaxymGorn reopened this Jul 30, 2024
@MaxymGorn MaxymGorn added the enhancement New feature or request label Jul 31, 2024
@MaxymGorn
Copy link
Member

Hi @AlbertLiu1974. New version of Cropper.Blazor will be realized which allows to use canvas or image reference in blazor to draw a polygon. New code was attached into dev branch.

@MaxymGorn
Copy link
Member

MaxymGorn commented Jul 31, 2024

You need to use GetCropperElementReference method to get reference into canvas or img and pass appropriate type for CropperComponentType parameter (default is img).
More info in api docs (some links can be broken for new types now, it will be fixed later): https://cropperblazor.github.io/api#properties
Screenshot_20240731_072503_Chrome
Screenshot_20240731_073605_Chrome

Just note for CropperComponentType.Canvas type requires manual uploading of images into canvas HTMl element, including error handling. You can use GetCropperElementReference to get canvas reference and use all power of canvas functionality!

@MaxymGorn
Copy link
Member

Hi @AlbertLiu1974. A new version of Cropper.Blazor (1.3.4) has been released that supports the mentioned topics!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants