本文整理汇总了C#中UIKit.UIImage.SaveToPhotosAlbum方法的典型用法代码示例。如果您正苦于以下问题:C# UIImage.SaveToPhotosAlbum方法的具体用法?C# UIImage.SaveToPhotosAlbum怎么用?C# UIImage.SaveToPhotosAlbum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIKit.UIImage
的用法示例。
在下文中一共展示了UIImage.SaveToPhotosAlbum方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SavePictureToDisk
public async void SavePictureToDisk(string photoPath)
{
var someImage = new UIImage(photoPath);
someImage.SaveToPhotosAlbum((image, error) => {
var o = image;
});
}
示例2: SavePictureToDisk
public async void SavePictureToDisk (String photoPath)
{
UIImage someImage = new UIImage (photoPath);
someImage.SaveToPhotosAlbum ((image, error) => {
var o = image as UIImage;
// Console.WriteLine ("Photo saved.");
});
}
示例3: doTakeSnapshot
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 ();
});
}
示例4: saveImageToGallery
/*
* 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;
}
示例5: CapturePhoto
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);
});
}
示例6: SaveUiImageToGallery
public void SaveUiImageToGallery(UIImage source)
{
source.SaveToPhotosAlbum((image, error) => {
Console.WriteLine("error:" + error);
});
}