Image fixes

This commit is contained in:
2026-01-24 03:18:08 +00:00
parent ed89b6494d
commit 433787ff80
7 changed files with 383 additions and 21 deletions

View File

@@ -24,6 +24,8 @@ public partial class ImageHandler : ViewHandler<IImage, SkiaImage>
[nameof(IView.Background)] = MapBackground,
["Width"] = MapWidth,
["Height"] = MapHeight,
["HorizontalOptions"] = MapHorizontalOptions,
["VerticalOptions"] = MapVerticalOptions,
};
public static CommandMapper<IImage, ImageHandler> CommandMapper = new(ViewHandler.ViewCommandMapper)
@@ -148,6 +150,26 @@ public partial class ImageHandler : ViewHandler<IImage, SkiaImage>
}
}
public static void MapHorizontalOptions(ImageHandler handler, IImage image)
{
if (handler.PlatformView is null) return;
if (image is Image img)
{
handler.PlatformView.HorizontalOptions = img.HorizontalOptions;
}
}
public static void MapVerticalOptions(ImageHandler handler, IImage image)
{
if (handler.PlatformView is null) return;
if (image is Image img)
{
handler.PlatformView.VerticalOptions = img.VerticalOptions;
}
}
// Image source loading helper
private ImageSourceServiceResultManager _sourceLoader = null!;