當前位置: 首頁>>代碼示例>>C#>>正文


C# UIImage.SaveToPhotosAlbum方法代碼示例

本文整理匯總了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;
      });
 }
開發者ID:dimgrek,項目名稱:PrivatePhotoStorageXamarin,代碼行數:7,代碼來源:AppDelegate.cs

示例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.");
			});
		}
開發者ID:Exis19ce,項目名稱:SecretGallery,代碼行數:8,代碼來源:AppDelegate.cs

示例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 ();
			});
		}
開發者ID:GoXuni,項目名稱:Xamarin.iOS-Samples,代碼行數:10,代碼來源:SnapshotController.cs

示例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;
        }
開發者ID:DawnMeh,項目名稱:WDGS,代碼行數:24,代碼來源:SaveAndLoadFilesiOS.cs

示例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);
			});
		}
開發者ID:ChandrakanthBCK,項目名稱:xamarin-forms-samples,代碼行數:11,代碼來源:CameraPageRenderer.cs

示例6: SaveUiImageToGallery

 public void SaveUiImageToGallery(UIImage source)
 {
     source.SaveToPhotosAlbum((image, error) => {
         Console.WriteLine("error:" + error);
     });
 }
開發者ID:dimgrek,項目名稱:TabbedAppXamarin,代碼行數:6,代碼來源:SaveImageService.cs


注:本文中的UIKit.UIImage.SaveToPhotosAlbum方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。