-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
custom size for canvas, image and cropper area #782
Comments
Duplicate of a lot of other issues!!!
|
For instance, I have a 358x400px div to hold Cropper (this is on mobile). If I load an 1127x634px image, it is mostly hidden, I only see the corner of it. I would like it to display at a scaled resolution of 358x201px, without that affecting the size of the resulting crop. Is it possible? I'm afraid if I set the dimensions to fit the image in my container it will reduce the resolution of the cropped image. If I add CSS like so, it scrunches the image horizontally: cropper-image {
max-width: 100%;
height: auto;
} ...whereas with an |
@inorganik As of v2, the image is transformed by matrix, so it is hard to calculate its actual visual dimension. const matrix = cropperImage.$getTransform();
// Try to calculate the following values with the `matrix` by yourself.
const visualX = ?;
const visualY = ?;
const visualWidth = ?;
const visualHeight = ?; |
Can you tell me how to change the cropper dimensions from a square to a rectangle? |
@JoshThomson7 How about the |
In v2 I am no longer able to set a min or actual width of the image, when I pull a 3000px wide image in the canvas its 3000px instead of the max canvas size of 100% viewport width which I set. How can I limit the dimensions? |
I am trying to achieve the fixed size of the canvas area, the image size should come less than canvas area, and cropping area height should be equal to image height and cropping area width should be image width + some extra space like 20px margin.
to do this I am trying to below test, but my result is coming accurate or a little bit similar.
Do you have any idea or suggestion, please?
My Script:
PlayGround: https://jsfiddle.net/bke1od4w/
expected result in the image:
The text was updated successfully, but these errors were encountered: