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?