ImageCropper.Maui
1.0.0
See the version list below for details.
dotnet add package ImageCropper.Maui --version 1.0.0
NuGet\Install-Package ImageCropper.Maui -Version 1.0.0
<PackageReference Include="ImageCropper.Maui" Version="1.0.0" />
paket add ImageCropper.Maui --version 1.0.0
#r "nuget: ImageCropper.Maui, 1.0.0"
// Install ImageCropper.Maui as a Cake Addin #addin nuget:?package=ImageCropper.Maui&version=1.0.0 // Install ImageCropper.Maui as a Cake Tool #tool nuget:?package=ImageCropper.Maui&version=1.0.0
ImageCropper.Maui
.NET MAUI plugin to crop and rotate photos.
Ported over and updated from from : https://github.com/stormlion227/ImageCropper.Forms
Supports Android and iOS.
- Android library from : https://github.com/CanHub/Android-Image-Cropper
- iOS library from : https://github.com/TimOliver/TOCropViewController
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0-android31.0 is compatible. net6.0-ios16.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net8.0-android was computed. net8.0-ios was computed. |
-
net6.0-android31.0
- Com.Vanniktech.AndroidImageCropper.Maui (>= 4.4.0)
-
net6.0-ios16.0
- System.Runtime.InteropServices.NFloat.Internal (>= 6.0.1)
- TimOliver.TOCropViewController.Maui (>= 2.3.6)
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.2.3 | 1,176 | 9/17/2024 |
1.2.2 | 115 | 9/17/2024 |
1.2.1 | 712 | 9/12/2024 |
1.2.0 | 1,387 | 8/3/2024 |
1.1.0.7 | 14,690 | 3/29/2024 |
1.1.0.6 | 122 | 3/29/2024 |
1.1.0.5 | 218 | 3/27/2024 |
1.1.0.4 | 131 | 3/27/2024 |
1.1.0.2 | 193 | 3/23/2024 |
1.1.0.1 | 151 | 3/23/2024 |
1.0.3 | 16,218 | 1/25/2023 |
1.0.2 | 509 | 12/20/2022 |
1.0.1 | 345 | 12/19/2022 |
1.0.0 | 414 | 11/1/2022 |
1.0.0-alpha | 152 | 10/31/2022 |