[V2] Use selection's $toCanvas method on zoomed canvas and get selection at original scale? #1256
Unanswered
nathanhennig
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Just change the value of the cropperSelection.$toCanvas({
width: 450,
height: 620,
}); |
Beta Was this translation helpful? Give feedback.
2 replies
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.
-
I think I've seen this question asked a couple times such as #1130, but the only reply I've seen is @fengyuanchen mentioning the width and height options, which doesn't actually produce results I desire.
In my use case, I'm taking a 1920x1080 picture of my face with my web cam. If I manually crop that picture in Paint or similar software, I get an image about 450x620 pixels. Using cropperjs, it's about 194x235. If I set width: 1920, then the saved image is about 1920x2125.
What I'm really looking for is a way to tell cropperjs to honor the region I've selected but ignore the zoom and save that region at the original scale.
So far the "solution" I've found is to make the canvas big enough, then zoom in to 100% and select the region before cropping and saving, which gives me an image the same size as if I had done it manually.
As a workaround, since I know approximately the size I expect, I can hard code a value like width: 450 and get reasonable results, but it feels like a solution that will likely cause problems for me in the future.
Have I missed anything? Is there any way currently to get the selected region of a zoomed canvas without getting a re-scaled/zoomed image?
Beta Was this translation helpful? Give feedback.
All reactions