Ejemplo n.º 1
0
        /// <summary>
        /// Sets thumbnail of the last taken photo.
        /// </summary>
        /// <param name="cameraCapturingEventArgs">Photo's details.</param>
        private void SetThumbnail(CameraCapturingEventArgs cameraCapturingEventArgs)
        {
            try
            {
                _photoThumbnail = new Image();

                if (cameraCapturingEventArgs.Thumbnail is null)
                {
                    _photoThumbnail.Source = ImageSource.FromStream(() =>
                                                                    new MemoryStream(cameraCapturingEventArgs.MainImage.Data));
                }
                else
                {
                    _photoThumbnail.Source = ImageSource.FromStream(() =>
                                                                    new MemoryStream(cameraCapturingEventArgs.Thumbnail.Data));
                }
            }
            catch (Exception exception)
            {
                ErrorHandler("Error while setting thumbnail: " + exception.Message);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Handles Capturing event.
 /// Stores information about taken photo.
 /// </summary>
 /// <param name="sender">Event sender.</param>
 /// <param name="cameraCapturingEventArgs">Photo's details.</param>
 private void OnCapturing(object sender, CameraCapturingEventArgs cameraCapturingEventArgs)
 {
     _capturedPhoto = cameraCapturingEventArgs.MainImage;
     SetThumbnail(cameraCapturingEventArgs);
 }