コード例 #1
0
        private async void camera_Tapped(object sender, EventArgs e)
        {
            AbMediaContent image = await MediaCaptureUtilities.takePicture(parentCard, parentPage);

            if (image != null)
            {
                this.imageFilePath  = image.filePath;
                contactImage.Source = ImageSource.FromFile(imageFilePath);
            }
        }
コード例 #2
0
        private async void takePictureButton_Clicked(object sender, EventArgs e)
        {
            //mediaCapturePreClick?.Invoke();
            if (cardProvider != null)
            {
                this.card = await cardProvider.getCardAsync();
            }

            await MediaCaptureUtilities.takePicture(card, parentPage);
        }
コード例 #3
0
        public async void addClicked()
        {
            MediaContentType mediaType;

            if (Enum.TryParse <MediaContentType>(this.title, out mediaType))
            {
                switch (mediaType)
                {
                case MediaContentType.Image:
                    await MediaCaptureUtilities.takePicture(this.card, this.parentPage);

                    break;

                case MediaContentType.Video:
                    await MediaCaptureUtilities.takeVideo(this.card, this.parentPage);

                    break;

                default:     //audio or note not supported
                    break;
                }
            }
        }