Baseflow / Baseflow/PhotoView

How to get x, y coordinate in terms of the photo's dimensions for what is displayed

Open
#750 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
18.8k
Forks
3.9k
PR merge metrics
No merged PRs in 30d

Description

The photo has some dimensions, the display some other, the display rect of PhotoView some other. I'd simply like to get the coordinates of the window in terms of the image's actual width and height (so I can crop the image into exactly what it looks like in the window)

```
Timber.d("rectf : " + it.toString())
Timber.d("imageMatrix : " + ui.nineGridImageVertical.imageMatrix.toString())
Timber.d("scale : " + ui.nineGridImageVertical.scale.toString())
```

I've been playing a fair bit with the above methods. I know I'm close, I can smell it, but I've been stuck on this for hours.

Just wondering if there's an officially recommended way to do this 😄 Any ideas?

Below is an example of a zoomed in panned around image. I'd like to know exactly how far away from the top left and bottom right did the user pan around, so I can crop out exactly the dimensions that are visible in the screen.

![image](https://user-images.githubusercontent.com/13274079/75557081-67ecf280-5a65-11ea-97e9-469f0d66f620.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.