CaptureInSdRam does not work.
Posted: Thu Mar 02, 2017 1:38 pm
We're trying to capture photos in the sd card. We use the following code:
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?
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);
}
What should I do in that handler to transfer the file to the sd card?