Ejemplo n.º 1
0
 /// <summary>
 /// Gets the cropped image.
 /// </summary>
 /// <returns>WriteableBitmap</returns>
 public async Task <WriteableBitmap> GetCroppedBitmapAsync()
 {
     if (SourceImage == null)
     {
         return(null);
     }
     return(await SourceImage.GetCroppedBitmapAsync(_currentCroppedRect));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Save the cropped image to a file.
        /// </summary>
        /// <param name="imageFile">The target file.</param>
        /// <param name="encoderId">The encoderId of BitmapEncoder</param>
        /// <returns></returns>
        public async Task SaveCroppedBitmapAsync(StorageFile imageFile, Guid encoderId)
        {
            if (SourceImage == null)
            {
                return;
            }
            var croppedBitmap = await SourceImage.GetCroppedBitmapAsync(_currentCroppedRect);

            await croppedBitmap.RenderToFile(imageFile, encoderId);
        }