Skip to content

Crop Image Control

The Crop Image Control will let you easily implement a control that allows the user to crop an image down to the selected size.

CropImage

Properties

Source - ImageSource

Gets or sets the image source.

Methods

Stream ResizeImageForExportAsStream(int quality = 80, SKEncodedImageFormat imageFormat = SKEncodedImageFormat.Png, bool streamDisposesData = true)

Resizes the image for export as stream.

quality: The quality level to use for the image. This is in the range from 0-100.

imageFormat: The image format expected back from the operation. Default value is SKEncodedImageFormat.Png

streamDisposesDataquality: If set to true stream disposes data.

byte[] CropImageForExport(int quality = 80, SKEncodedImageFormat imageFormat = SKEncodedImageFormat.Png)

Crops the image for export.

quality: The quality level to use for the image. This is in the range from 0-100.

imageFormat: The image format expected back from the operation. Default value is SKEncodedImageFormat.Png

Example Usage

Xaml

<aurora:CropImage x:Name="TheCropper" Source="http://i.onionstatic.com/avclub/5800/64/16x9/960.png" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />

C#

var cropper = New CropImage
{
    Source = "http://i.onionstatic.com/avclub/5800/64/16x9/960.png"
};