admin管理员组文章数量:1242790
I am developing a React Native mobile application that requires a fixed shape overlay (a top-down view of an apple) on the camera preview. The user must adjust the phone’s position to align a real object with the fixed shape.
Additionally, the app must restrict the user from taking a photo unless the object is perfectly aligned with the overlay.
What I have tried:
Using react-native-camera
- Successfully displayed the camera preview and overlaid a
<View>
with an SVG shape (usingreact-native-svg
). - The overlay was not correctly transparent, and the performance was not optimal.
- Successfully displayed the camera preview and overlaid a
Using react-native-vision-camera
- Implemented the camera preview with a transparent overlay.
- Used
react-native-reanimated
to animate minor adjustments, but keeping the overlay fixed at the center was problematic. - Did not find a straightforward way to validate the object alignment and restrict photo-taking accordingly.
What I need help with:
- Ensuring the overlay remains perfectly fixed at the center of the camera view while the user moves the phone.
- Implementing alignment validation so the shutter button is only enabled when the object is correctly aligned with the overlay.
Any guidance or examples would be greatly appreciated!
本文标签: androidFixing Position and Enforcing Object Alignment Before Capture with React NativeStack Overflow
版权声明:本文标题:android - Fixing Position and Enforcing Object Alignment Before Capture with React Native - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740164102a2234971.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论