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

How to zoom specific part of the image ? #86

Open
laxmi-lal-menaria opened this issue Dec 8, 2014 · 1 comment
Open

How to zoom specific part of the image ? #86

laxmi-lal-menaria opened this issue Dec 8, 2014 · 1 comment

Comments

@laxmi-lal-menaria
Copy link

I would like to zoom specific part of the image, I have tried the moveTo/setCoords but I think its not working.

Please let me know how can I do this..

i.e If I have a image size 800*600, would like to zoom the top left area on button click, on next button zoom the right area, on next button zoom middle ...and so on...

@can3p
Copy link
Collaborator

can3p commented Dec 8, 2014

There is no ready method for that, but you can implement it yourself. Suppose you have width, height and coordinates of desired area. widget stores dimensions of the container in the options object. So, from that values you can get the zoom value, that you need to set in order to fit this area in viewport of container. You can set this value to via set_zoom method. After that it's possible to center image in a proper place via moveTo method.

Current api is not that easy to use in all cases, so sometimes it's not trivial how to implement this or that.

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

2 participants