Add a camera feature to an app in which users who use the app can use the camera feature to upload an image onto the app using Smartface?

92 views Asked by At

Add a camera feature to an app in which users who use the app can use the camera feature to upload an image onto the app using Smartface?

I've tried implementing a camera feature but it didn't go well.

Thankyou

1

There are 1 answers

5
Ed Glazer On

You can add camera feature to the app using below codes:

var btn = new SMF.UI.TextButton({
     top : "70%",
     text : "Camera",
     onPressed : Page1_TextButton1_OnPressed
});
Pages.Page1.add(btn);
         function Page1_TextButton1_OnPressed(e) {
            SMF.Multimedia.startCamera({
                cameraType : 1, //rear camera
                resolution : 2, //large resolution
                autoFocus : true,
                onStart : function () {}, //do nothing
                onCapture : function (e) {
                    alert("path=" + e.photoUri);
                },
                onCancel : function () {}, //do nothing
                onFailure : function () {}
                //do nothing
            });
        }