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

xCamera windows appears tilted by -90 degrees #33

Open
shoumikdas opened this issue Jan 3, 2021 · 1 comment
Open

xCamera windows appears tilted by -90 degrees #33

shoumikdas opened this issue Jan 3, 2021 · 1 comment

Comments

@shoumikdas
Copy link

Hi, I have managed to integrate xCamera in my Kivy app for Android use the recommended requirements and code examples. The app is launching fine and able to take photographs. I initialized the XCamera object in Kivy instead of Python. One thing I noticed is that we have to let the camera auto-focus for a couple of seconds before clicking the picture, else it crashes.

The problem I have noticed is that my camera seems to initialize in the landscape mode by default. In the buildozer.spec file, the orientation is set to 'portrait' for the app. How can I make the camera view appear straight in portrait mode? Here is a screenshot of my problem. The door appears horizontal even if my phone is held upright. If turn around my phone, the camera view tilts even further by -90 degrees. How can I fix this?

If I use the force_landscape() method, the camera works as intended in the landscape mode, but then my app's orientation is also set to landscape mode permanently. It does not revert back to portrait mode even if I use the restore_orientation() method.

I am using Kivy 2.0.0 on Python 3.8.x. App packaged with buildozer. WRITE_EXTERNAL_STORAGE and CAMERA permissions are provided. Screenshot attached.

aa3d62fc-32b4-40d2-8a88-337134a962b9

@Arjun-nemani
Copy link

Arjun-nemani commented Jun 25, 2021

#:import XCamera kivy_garden.xcamera.XCamera

canvas.before:
PushMatrix
Rotate:
angle: -90
origin: self.center
canvas.after:
PopMatrix

You can rotate it , its not a solution but its a workaround

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