public async void SavePictureToDisk(string photoPath) { var someImage = new UIImage(photoPath); someImage.SaveToPhotosAlbum((image, error) => { var o = image; }); }
public async void SavePictureToDisk (String photoPath) { UIImage someImage = new UIImage (photoPath); someImage.SaveToPhotosAlbum ((image, error) => { var o = image as UIImage; // Console.WriteLine ("Photo saved."); }); }
partial void doTakeSnapshot (UIBarButtonItem sender) { UIImage img = new UIImage (flexPie.GetImage ()); img.SaveToPhotosAlbum ((image, error) => { if (error == null) new UIAlertView ("Success", "Image was saved to Camera Roll succesfully", null, "OK", null).Show (); else new UIAlertView ("Failure", error.Description, null, "OK", null).Show (); }); }
/* * saves an image taken with the camera to the users gallery * * Params: * string fileName: the file name to save the image under * byte[] imageBytes: a byte array of the image data * * Returns: * a string message indicating if the save was successful or failed */ public String saveImageToGallery(string fileName, byte[] imageBytes) { var message = ""; var imageToSave = new UIImage(NSData.FromArray(imageBytes)); imageToSave.SaveToPhotosAlbum((image, error) => { if (error != null) { message = "error"; } }); return message; }
async void CapturePhoto () { var videoConnection = stillImageOutput.ConnectionFromMediaType (AVMediaType.Video); var sampleBuffer = await stillImageOutput.CaptureStillImageTaskAsync (videoConnection); var jpegImage = AVCaptureStillImageOutput.JpegStillToNSData (sampleBuffer); var photo = new UIImage (jpegImage); photo.SaveToPhotosAlbum ((image, error) => { Console.Error.WriteLine (@" Error: ", error); }); }
public void SaveUiImageToGallery(UIImage source) { source.SaveToPhotosAlbum((image, error) => { Console.WriteLine("error:" + error); }); }