Created
May 12, 2015 09:44
-
-
Save MilenPavlov/493c26952da76bec4b87 to your computer and use it in GitHub Desktop.
SavePhotoToAppDirectory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void SavePhotoToAppDirectory(NSData data) | |
{ | |
var documentsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); | |
var jpgFilename = System.IO.Path.Combine(documentsDirectory, | |
$"Photo{DateTime.Now.TimeOfDay.Milliseconds}.jpg"); | |
if (File.Exists(jpgFilename)) return; | |
NSError err = null; | |
if (!data.Save(jpgFilename, false, out err)) | |
{ | |
Trace(err.LocalizedDescription, false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment