Esempio n. 1
0
 void onPhotoModeStarted(UnityEngine.XR.WSA.WebCam.PhotoCapture.PhotoCaptureResult result)
 {
     if (result.success)
     {
         //saveToFile();
         photoCapture.TakePhotoAsync(onCapturedPhotoToMemory);
     }
     else
     {
         Debug.LogError("Unable to start photo mode");
     }
 }
Esempio n. 2
0
 public void TakeAShot()
 {
     Debug.Log("take a picture!!!");
     Debug.Log(photoCaptureObject != null);
     if (photoCaptureObject != null)
     {
         photoCaptureObject.TakePhotoAsync(OnCapturedPhotoToMemory);
     }
 }
Esempio n. 3
0
 public void TakePhoto()
 {
     if (isCapturingPhoto)
     {
         return;
     }
     isCapturingPhoto = true;
     photoCaptureObj.TakePhotoAsync(OnPhotoCaptured);
 }
Esempio n. 4
0
 private void OnPhotoModeStarted(UnityEngine.XR.WSA.WebCam.PhotoCapture.PhotoCaptureResult result)
 {
     if (result.success)
     {
         photoCaptureObject.TakePhotoAsync(OnCapturedPhotoToMemory);
     }
     else
     {
     }
 }
Esempio n. 5
0
 // Démarrage du mmode photo
 private void OnPhotoModeStarted(UnityEngine.XR.WSA.WebCam.PhotoCapture.PhotoCaptureResult result)
 {
     if (result.success)
     {
         Debug.Log("Camera ready");
         photo_capture_.TakePhotoAsync(OnCapturedPhotoToMemory);
     }
     else
     {
         Debug.LogError("Unable to start photo mode!");
         _processing = false;
     }
 }
Esempio n. 6
0
    /// <summary>
    /// Take a photo anbd start the backend handling
    /// </summary>
    void ExecutePictureProcess()
    {
        if (m_photoCapture != null)
        {
            //Take a picture
            m_photoCapture.TakePhotoAsync(delegate(UnityEngine.XR.WSA.WebCam.PhotoCapture.PhotoCaptureResult result, UnityEngine.XR.WSA.WebCam.PhotoCaptureFrame photoCaptureFrame)
            {
                List <byte> buffer = new List <byte>();

                photoCaptureFrame.CopyRawImageDataIntoBuffer(buffer);

                //Start a coroutine to handle the server request
                StartCoroutine(UploadAndHandlePhoto(buffer.ToArray()));
            });
        }
    }