Skip to content

InquisitorJax/Wibci.Xamarin.Images

Repository files navigation

Wibci.Xamarin.Images

Some handy xamarin cross platform (Android / iOS / UWP) commands for byte[] image manipulation. See the Sample App for example usages.

  • Available on NuGet: NuGet

  • ResizeImageCommand: resize an image with specific width / height. Maintains aspect ratio.

  • AnalyseImageCommand: Get the height, width and size of a given image

  • ConvertImageCommand: Convert images between jpeg and png formats

  • ImageTools: Methods for all 3 above

Read more about it here

Sample code: Resize an image

var resizeImage = DependencyService.Get<IResizeImageCommand>();

var resizeResult = await resizeImage.ExecuteAsync(new ResizeImageContext { Height = 130, Width = 280, OriginalImage = pictureResult.Image });

if (resizeResult.TaskResult == TaskResult.Success)
{
  Model.Logo = resizeResult.ResizedImage;
}

Platform implementations:

Android: DependencyService.Register<IResizeImageCommand, AndroidResizeImageCommand>();

iOS DependencyService.Register<IResizeImageCommand, iOSImageResizeCommand>();

UWP: DependencyService.Register<IResizeImageCommand, UWPResizeImageCommand>();

For anyone looking for a much more comprehensive image library that is .NET standard compliant, check out https://github.com/SixLabors/ImageSharp

About

Some handy xamarin cross platform (Android / iOS / UWP) commands for image resize, analyse & convert

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages