❔ MAUI ImageButton Aspect not working

I'm working on a tool that should allow users to swap out an image in this ImageButton by clicking on it. On Mac it works fine (first screenshot). However, on Windows (second screenshot) it gets cropped no matter what settings I apply to it.
// Button XAML
<ImageButton x:Name="Thumbnail_0" Aspect="AspectFill" Clicked="EditThumbnail" WidthRequest="445" HeightRequest="251" MaximumWidthRequest="445" MaximumHeightRequest="251"/>
// Button XAML
<ImageButton x:Name="Thumbnail_0" Aspect="AspectFill" Clicked="EditThumbnail" WidthRequest="445" HeightRequest="251" MaximumWidthRequest="445" MaximumHeightRequest="251"/>
// Image swapping
async void EditThumbnail(object sender, EventArgs e)
{
var src = (ImageButton)sender;
var width = src.Width;
var height = src.Height;

try
{
// My own thing
var file = await FilePick.PickSource();
if (!file.IsEmpty)
src.Source = file;
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
// Image swapping
async void EditThumbnail(object sender, EventArgs e)
{
var src = (ImageButton)sender;
var width = src.Width;
var height = src.Height;

try
{
// My own thing
var file = await FilePick.PickSource();
if (!file.IsEmpty)
src.Source = file;
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
}
Please advise
4 Replies
Nate Curtiss
Nate CurtissOP2y ago
Mac ^^^
Nate Curtiss
Nate CurtissOP2y ago
Nate Curtiss
Nate CurtissOP2y ago
Windows ^^^ --- @GUI
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server