void onPhotoModeStarted(UnityEngine.XR.WSA.WebCam.PhotoCapture.PhotoCaptureResult result) { if (result.success) { //saveToFile(); photoCapture.TakePhotoAsync(onCapturedPhotoToMemory); } else { Debug.LogError("Unable to start photo mode"); } }
public void TakeAShot() { Debug.Log("take a picture!!!"); Debug.Log(photoCaptureObject != null); if (photoCaptureObject != null) { photoCaptureObject.TakePhotoAsync(OnCapturedPhotoToMemory); } }
public void TakePhoto() { if (isCapturingPhoto) { return; } isCapturingPhoto = true; photoCaptureObj.TakePhotoAsync(OnPhotoCaptured); }
private void OnPhotoModeStarted(UnityEngine.XR.WSA.WebCam.PhotoCapture.PhotoCaptureResult result) { if (result.success) { photoCaptureObject.TakePhotoAsync(OnCapturedPhotoToMemory); } else { } }
// 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; } }
/// <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())); }); } }