Skip to content

[Question]: Set Zoom for the cropper on initilization #182

Description

@saadsaeed01

Hi

I have an issue that I wanted to discuss related to setting up the initial Zoom

Let's say when I upload the image the initial state of the cropper is this

image

Now without Zooming in or Zooming out, I change the position of the crop window and save my entity
image

If I now save my card the position of the cropper window will persist. The image below shows the position of the cropper window when I save my card and visit the page again
image

Problem
If I Zoom out or Zoom In in the cropper like this and save the entity
image

The zoom is not persisted. Check what happened below
image

I am saving the following Meta Information

  • Height
  • Width
  • ScaleX
  • ScaleY
  • X
  • Y
  • Rotate
  • OldRatio (Fetched from OnZoomEvent)
  • Ratio (Fetched from OnZoomEvent)

On initializing the cropper, I set the non-zoom properties like this in SetDataOptions
image

And I set the zoom properties by calling the ZoomTo method
image

Is there a special way to set the zoom of the canvas, unfortunately, I am not very clear about this. Waiting for your response

I am using Blazor Server NET 6 and the package version is 1.2.4 which is the latest stable

Thank you very much!

Regards
Saad

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersquestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions