简体   繁体   中英

How can I get an image from Android camera using Qt/C++ Widgets (Not QML)

I would like to use Android camera for my Qt Widgets application. But when I try to run the camera example of qt on Android, I only get a black screen. I dont want to use QML for now. Just want to figure out how to do it on Qt Widgets app.

When I try to use camera on android I get this message on debug

W libcamera.so: (null):0 ((null)): The video surface is not compatible with any format supported by the camera

I dont understand how qt can get the image from qml but not on QCamera.

Here is an example. Anyway, I'm not sure why you want to use Qt Widgets for a mobile application. It will make things unnecessarily much more complicated.

https://doc.qt.io/qt-5/qtmultimedia-multimediawidgets-camera-example.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM