ImageCropper.Maui 1.1.0.7

dotnet add package ImageCropper.Maui --version 1.1.0.7
NuGet\Install-Package ImageCropper.Maui -Version 1.1.0.7
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ImageCropper.Maui" Version="1.1.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ImageCropper.Maui --version 1.1.0.7
#r "nuget: ImageCropper.Maui, 1.1.0.7"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ImageCropper.Maui as a Cake Addin
#addin nuget:?package=ImageCropper.Maui&version=1.1.0.7

// Install ImageCropper.Maui as a Cake Tool
#tool nuget:?package=ImageCropper.Maui&version=1.1.0.7

ImageCropper.Maui

.NET MAUI plugin to crop and rotate photos.

Ported over and updated from from : https://github.com/stormlion227/ImageCropper.Forms

NuGet

Supports Android and iOS.

Features

  • Cropping image.
  • Rotating image.
  • Aspect ratio.
  • Circle/Rectangle shape.

Screen-Shots

Android

<img src="ScreenShots/Android_Rectangle.gif" alt="Crop/Rotate image(Rectangle/Android)"/> <img src="ScreenShots/Android_Circle.gif" alt="Crop/Rotate image(Circle/Android)"/>

iOS

<img src="ScreenShots/iOS_Rectangle.gif" alt="Crop/Rotate image(Rectangle/iOS)"/> <img src="ScreenShots/iOS_Circle.gif" alt="Crop/Rotate image(Circle/iOS)" />

Setup

  • Install the nuget package in portable and all platform specific projects.
  • This plugin uses the MediaPicker, so be sure to complete the full setup this. Please fully read through the MediaPicker description.

Android

Add the following to your AndroidManifest.xml inside the <application> tags:

	<activity android:name="com.canhub.cropper.CropImageActivity"
	          android:theme="@style/Base.Theme.AppCompat"/>	

In MainActivity.cs file:

    new ImageCropper.Maui.Platform.Init();


### iOS

In AppDelegate.cs file:

```cs
     new ImageCropper.Maui.Platform.Init();

Usage

Show ImageCropper page.

    new ImageCropper()
    {
        Success = (imageFile) =>
        {
            Dispatcher.Dispatch(() =>
            {
                imageView.Source = ImageSource.FromFile(imageFile);
            });
        }
    }.Show(this);

Show it with additional parameters.

    new ImageCropper()
    {
        PageTitle = "Test Title",
        AspectRatioX = 1,
        AspectRatioY = 1,
	CropShape = ImageCropper.CropShapeType.Oval,
	SelectSourceTitle = "Select source",
	TakePhotoTitle = "Take Photo",
	PhotoLibraryTitle = "Photo Library",
	CancelButtonTitle = "Cancel",
        Success = (imageFile) =>
        {
            Dispatcher.Dispatch(() =>
            {
                imageView.Source = ImageSource.FromFile(imageFile);
            });
        }
    }.Show(this);

Show it with a image

    new ImageCropper()
    {
        Success = (imageFile) =>
        {
            Dispatcher.Dispatch(() =>
            {
                imageView.Source = ImageSource.FromFile(imageFile);
            });
        }
    }.Show(this, imageFileName);

Properties

  • PageTitle
  • AspectRatioX
  • AspectRatioY
  • CropShape
  • Initial image can be set in Show function.

Contributions

Contributions are welcome!

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-android33.0 is compatible.  net7.0-ios was computed.  net7.0-ios16.1 is compatible.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-android34.0 is compatible.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-ios17.2 is compatible.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0.7 952 3/29/2024
1.1.0.6 66 3/29/2024
1.1.0.5 171 3/27/2024
1.1.0.4 90 3/27/2024
1.1.0.2 151 3/23/2024
1.1.0.1 91 3/23/2024
1.0.3 13,878 1/25/2023
1.0.2 465 12/20/2022
1.0.1 308 12/19/2022
1.0.0 381 11/1/2022
1.0.0-alpha 119 10/31/2022