Users from old forum should register again, the old credentials no longer are valid

CaptureInSdRam does not work.

Post Reply
AndreasFurster
Posts: 6
Joined: Tue Feb 28, 2017 7:13 pm

CaptureInSdRam does not work.

Post by AndreasFurster » Thu Mar 02, 2017 1:38 pm

We're trying to capture photos in the sd card. We use the following code:

Code: Select all

device.CaptureInSdRam = true;
Thread(CapturePicture).Start(device);

Code: Select all

 
        private void CapturePicture(object device)
        {
            bool doRetry;

            do
            {
                doRetry = false;
                try
                {
                    ((ICameraDevice)device).CapturePhoto();
                }
                catch (DeviceException exception)
                {
                    if (exception.ErrorCode == ErrorCodes.MTP_Device_Busy || exception.ErrorCode == ErrorCodes.ERROR_BUSY)
                    {
                        Thread.Sleep(500);
                        doRetry = true;
                    }
                    else
                    {
                        throw;
                    }
                }
            } while (doRetry);
        }
The PhotoCaptured event is fired, but I don't handle it. Is this required?
What should I do in that handler to transfer the file to the sd card?

CaptureInSdRam does not work.

Advertisment
 

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest