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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃挱 How to translate preview point to screen point with resizeMode contain? #2929

Open
3 of 4 tasks
tomerh2001 opened this issue Jun 2, 2024 · 2 comments
Open
3 of 4 tasks
Labels
馃挱 question Further information is requested

Comments

@tomerh2001
Copy link

tomerh2001 commented Jun 2, 2024

Question

I am using resize mode contain, so black bars appear at the camera's start and end.

I want to find the (0, 0) point of the preview in screen coordinates, accounting for the black bars.
image

But everything I tried seems to return the incorrect position on the screen, so I'm either experiencing a missing ; moment or missing some of the correct information.

How are the black bars calculated? How can I find the X from above using the parameters available in react-native-vision-camera?

If anyone could provide a previewPointToScreenPoint function or a getBlackBarsHeight function, that'd be very appreciated.

What I tried

No response

VisionCamera Version

4.0.5

Additional information

@tomerh2001 tomerh2001 added the 馃挱 question Further information is requested label Jun 2, 2024
@tomerh2001
Copy link
Author

Possibly related to #2853

@maintenance-hans maintenance-hans bot changed the title How to translate preview point to screen point with resizeMode contain? 馃挱 How to translate preview point to screen point with resizeMode contain? Jun 11, 2024
Copy link

maintenance-hans bot commented Jun 11, 2024

Guten Tag, Hans here.

Note

New features, bugfixes, updates and other improvements are all handled mostly by Marc Rousavy in his free time.
To support Marc, please consider 馃挅 sponsoring him on GitHub 馃挅.
Sponsored issues will be prioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃挱 question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant