Ejemplo n.º 1
0
		async void doPhotoLibrary(PhotoListData pld)
		{
			#if __ANDROID__
			MediaPicker picker = new MediaPicker(Forms.Context);
			#else
			MediaPicker picker = new MediaPicker();
			#endif

			if (picker.IsPhotoGalleryAvailable == false)
			{
				var page = new ContentPage();
				var result = page.DisplayAlert("Warning", "Photo is not available", "OK");

				return;
			}
			else
			{
				try
				{
					var resultfile = await picker.PickPhoto();
					#if __ANDROID__
					//showDrawingView(pld);
					#else
					//showDrawingView(pld);
					#endif
				}
				catch (Exception e)
				{
				}
			}
		}
Ejemplo n.º 2
0
		async void doCameraPhoto(PhotoListData pld)
		{
			#if __ANDROID__
			MediaPicker picker = new MediaPicker(Forms.Context);
			#else
			MediaPicker picker = new MediaPicker();
			#endif

			if (picker.IsCameraAvailable == false)
			{
				var page = new ContentPage();
				var result = page.DisplayAlert("Warning", "Camera is not available", "OK");

				return;
			}
			else
			{
				try
				{
					var resultfile = await picker.TakePhoto(null);
					#if __ANDROID__
					showDrawingView(pld);
					#else
					showDrawingView(pld);
					#endif
				}
				catch (Exception ex)
				{
				}
			}
		}