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 ZoomState exposes offsetX, offsetY and scale so i can find what part of the image is being displayed. #190

Closed
osw-mj opened this issue Mar 22, 2024 · 5 comments

Comments

@osw-mj
Copy link

osw-mj commented Mar 22, 2024

Here is the explanation with example:

Suppose I've image A that is have full human body image and now using this library i've done zoomed to face and i've the button that will take me to next screen with image but that image should show me the image that I've zoomed to face not the old one of full body image.

@osw-mj
Copy link
Author

osw-mj commented Mar 25, 2024

Hey @usuiat How are you,
Sorry but can you look into my question, Let me know what you think about this.
Or do you have any confusion?
Response this comments if you read it.

@usuiat
Copy link
Owner

usuiat commented Mar 25, 2024

@osw-mj
Sorry for the late reply.
ZoomState exposes offsetX, offsetY and scale.
Using these properties, we may be able to guess which part of the image is being displayed.
Please let me know if there are any other properties you need.

@osw-mj
Copy link
Author

osw-mj commented Mar 25, 2024

Yes same i want to know the part displayed and want to convert that part into the image file.
Okay i think you know how it's possible can you make it easier for me means any function

@osw-mj osw-mj changed the title Question: How can i get the zoomed image output How ZoomState exposes offsetX, offsetY and scale so i can find what part of the image is being displayed. Mar 25, 2024
@usuiat
Copy link
Owner

usuiat commented Mar 25, 2024

The figure shows the scale, offsetX, and offsetY when the blue image size is zoomed to orange.
image

The visible area then becomes a green rectangle, which can be represented by the equation in the figure.

image

However, this is the case when the aspect ratio of the image and the display area match.
If the aspect ratios are different, it becomes more complicated.
Probably, the required rectangular area will vary from application to application.

@osw-mj
Copy link
Author

osw-mj commented Mar 29, 2024

Okay I'm closing this issue for now. Thank you.

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