Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public partial class ImageResizerService
{
// Source: https://github.com/xamarin/xamarin-forms-samples/blob/master/XamFormsImageResize/XamFormsImageResize/ImageResizer.cs
[SupportedOSPlatform(SPlatforms.AndroidVersion)]
public partial byte[] ResizeImage(byte[] imageData, float width, float height)
public static partial byte[] ResizeImage(byte[] imageData, float width, float height)
{
// Load the bitmap
Bitmap? originalImage = BitmapFactory.DecodeByteArray(imageData, 0, imageData.Length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class ImageResizerService
// Source: https://github.com/xamarin/xamarin-forms-samples/blob/master/XamFormsImageResize/XamFormsImageResize/ImageResizer.cs
[SupportedOSPlatform(SPlatforms.IOSVersion)]
[SupportedOSPlatform(SPlatforms.MACCatalystVersion)]
public partial byte[] ResizeImage(byte[] imageData, float width, float height)
public static partial byte[] ResizeImage(byte[] imageData, float width, float height)
{
UIImage? originalImage = ImageFromByteArray(imageData);
if (originalImage is null) return [];
Expand Down Expand Up @@ -51,7 +51,7 @@ public partial byte[] ResizeImage(byte[] imageData, float width, float height)
return [];
}

UIImage? ImageFromByteArray(byte[] data)
static UIImage? ImageFromByteArray(byte[] data)
{
if (data is null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace AndreasReitberger.Shared.Core.Services
public partial class ImageResizerService
{
[SupportedOSPlatform(SPlatforms.WindowsVersion)]
public partial byte[] ResizeImage(byte[] imageData, float width, float height)
public static partial byte[] ResizeImage(byte[] imageData, float width, float height)
{
ImageSource image = ImageSource.FromStream(() => new MemoryStream(imageData));
throw new NotImplementedException("Not implemented yet!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class ImageResizerService
// Source: https://github.com/xamarin/xamarin-forms-samples/blob/master/XamFormsImageResize/XamFormsImageResize/ImageResizer.cs
[SupportedOSPlatform(SPlatforms.IOSVersion)]
[SupportedOSPlatform(SPlatforms.MACCatalystVersion)]
public partial byte[] ResizeImage(byte[] imageData, float width, float height)
public static partial byte[] ResizeImage(byte[] imageData, float width, float height)
{
UIImage? originalImage = ImageFromByteArray(imageData);
if (originalImage is null) return [];
Expand Down Expand Up @@ -51,7 +51,7 @@ public partial byte[] ResizeImage(byte[] imageData, float width, float height)
return [];
}

UIImage? ImageFromByteArray(byte[] data)
static UIImage? ImageFromByteArray(byte[] data)
{
if (data is null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SharedMauiCoreLibrary/Services/ImageResizerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#if ANDROID || IOS || MACCATALYST || WINDOWS
public partial class ImageResizerService
{
public partial byte[] ResizeImage(byte[] imageData, float width, float height = -1);
public static partial byte[] ResizeImage(byte[] imageData, float width, float height = -1);
}
#endif
}
Loading