BrickPi.Tools.USBCam.TakePhotoAsync C# (CSharp) Method

TakePhotoAsync() private static method

Async method to take a photo. Do not forget to declare capabilities on the manifest < DeviceCapability Name="microphone" />
private static TakePhotoAsync ( string filename ) : Task
filename string Filename to store the file
return Task
        private static async Task<StorageFile> TakePhotoAsync(string filename)
        {
            StorageFile photoFile = await KnownFolders.PicturesLibrary.CreateFileAsync(
                    filename, CreationCollisionOption.GenerateUniqueName);
            ImageEncodingProperties imageProperties = ImageEncodingProperties.CreateJpeg();
            await mediaCapture.CapturePhotoToStorageFileAsync(imageProperties, photoFile);
            return photoFile;
            
        }