Exemple #1
0
        private static void InvokeOnCapturedPhotoToMemoryDelegate(PhotoCapture.OnCapturedToMemoryCallback callback, long hResult, IntPtr photoCaptureFramePtr)
        {
            PhotoCaptureFrame photoCaptureFrame = null;

            if (photoCaptureFramePtr != IntPtr.Zero)
            {
                photoCaptureFrame = new PhotoCaptureFrame(photoCaptureFramePtr);
            }
            callback(PhotoCapture.MakeCaptureResult(hResult), photoCaptureFrame);
        }
Exemple #2
0
        public void TakePhotoAsync(PhotoCapture.OnCapturedToMemoryCallback onCapturedPhotoToMemoryCallback)
        {
            bool flag = onCapturedPhotoToMemoryCallback == null;

            if (flag)
            {
                throw new ArgumentNullException("onCapturedPhotoToMemoryCallback");
            }
            this.CapturePhotoToMemory_Internal(onCapturedPhotoToMemoryCallback);
        }
Exemple #3
0
 public void TakePhotoAsync(PhotoCapture.OnCapturedToMemoryCallback onCapturedPhotoToMemoryCallback)
 {
     if (this.m_NativePtr == IntPtr.Zero)
     {
         throw new InvalidOperationException("You must create a Photo Capture Object before taking a photo.");
     }
     if (onCapturedPhotoToMemoryCallback == null)
     {
         throw new ArgumentNullException("onCapturedPhotoToMemoryCallback");
     }
     this.CapturePhotoToMemory_Internal(this.m_NativePtr, onCapturedPhotoToMemoryCallback);
 }
 public void CapturePhoto(PhotoCapture.OnCapturedToMemoryCallback callback)
 {
     if (_ready)
     {
         _captureObject.TakePhotoAsync(callback);
         if (DEBUG_DUMP_IMAGE)
         {
             Debug.LogWarning("Dumping webcam img...   " + string.Format(DEBUG_DUMP_IMAGE_NAME + "_{0}_webcam.jpg", System.DateTime.Now.Ticks));
             _captureObject.TakePhotoAsync(string.Format(DEBUG_DUMP_IMAGE_NAME + "_{0}_webcam.jpg", System.DateTime.Now.Ticks), PhotoCaptureFileOutputFormat.JPG, OnPhotoCapturedToDisk);
         }
     }
     else
     {
         Debug.LogWarning("CapturePhoto called before webcam has successfully initialized!");
         PhotoCapture.PhotoCaptureResult failure = new PhotoCapture.PhotoCaptureResult();
         failure.resultType = PhotoCapture.CaptureResultType.UnknownError;
         callback(new PhotoCapture.PhotoCaptureResult(), null);
     }
 }
Exemple #5
0
 private extern void CapturePhotoToMemory_Internal(IntPtr photoCaptureObj, PhotoCapture.OnCapturedToMemoryCallback onCapturedPhotoToMemoryCallback);