0

我使用 Qt 5.12.5,并且我有 qt quick controls 2 项目,我在我的 Android 设备上运行它。

现在我有一个问题,Not trigger 的imageSaved信号Camera

在下面当我点击按钮时相机应该捕捉

Button{
    onClicked: {
        camera.imageCapture.capture();
    }
}

单击按钮imageCaptured信号运行后,photoPrevew显示捕获的图像,onImageSaved但未运行,我的图库中看不到任何捕获的图像!

Camera {
    id: camera
    position: Camera.BackFace
    imageProcessing.whiteBalanceMode: CameraImageProcessing.WhiteBalanceFlash

    flash.mode: Camera.FlashRedEyeReduction
    imageCapture {
        onImageCaptured: {                  ///this runs after capturing
            camera.stop();
            console.log("preview="+preview); ///  preview=image://camera/preview_1
            photoPreview.source = preview    ///photoPreview shows the capthed Image
            var imgPath = camera.imageCapture.capturedImagePath
            console.log("image Path=>"+imgPath); /// path is null
        }
        onCaptureFailed: {
            console.log("onCaptureFailed");
            console.log(message);
        }
        onImageSaved: {                             ///This not running
            console.log("*** onImageSaved ***");
            console.log("path=> "+path);
            up.loadImageFromFile("file://"+ path,imageOrientation);//this class upload Image to server
        }
    }
    focus {
        focusMode: Camera.FocusContinuous
        focusPointMode: Camera.FocusPointCenter
    }
}

应用程序输出

D ViewRootImpl: ViewPostImeInputStage processPointer 0
D ViewRootImpl: ViewPostImeInputStage processPointer 1
D SensorManager: registerListener :: 0, BMC150 Acceleration Sensor, 200000, 0,
E libGLESv1: HWUI Protection: wrong call from hwui context F:ES1-glDeleteTexturesSEC
D libEGL  : eglInitialize EGLDisplay = 0x9a3ff074
D libEGL  : eglInitialize EGLDisplay = 0x9a3ff074
D libEGL  : eglInitialize EGLDisplay = 0x9a3ff074
D ViewRootImpl: ViewPostImeInputStage processPointer 0
D ViewRootImpl: ViewPostImeInputStage processPointer 1
D SensorManager: unregisterListener ::
D Camera  : app passed NULL surface
D libEGL  : eglTerminate EGLDisplay = 0x9727ee84
D libEGL  : eglTerminate EGLDisplay = 0x9727ee84
D Camera  : app passed NULL surface
D libEGL  : eglTerminate EGLDisplay = 0xaea744cc
D libEGL  : eglTerminate EGLDisplay = 0xaea744b4
D MYAPP: qml: preview=image://camera/preview_1
D MYAPP: qml: image Path=>
4

0 回答 0