Syncfusion .NET MAUI Image Editor (SfImageEditor) allows you to resize the image. The following demonstration will help you to understand how to resize the image. XAML: Initialize the Image Editor control and provide a ButtonClicked event to resize the image. <Grid RowDefinitions="0.9*,0.1*"> <imageEditor:SfImageEditor x:Name="imageEditor" Source="image.png"/> <Button Text="Save" Clicked="OnButtonClicked" Grid.Row="1" HorizontalOptions="Center" VerticalOptions="End" Margin="0,0,20,20"/> </Grid> C#: In the ButtonClicked event, resize the image by the Save method call with the newly defined size. private void OnButtonClicked(object sender, EventArgs e) { this.imageEditor.Save(imageSize: new Size(200, 200)); } View the sample on GitHub. Conclusion: I hope you enjoyed learning how to resize the image in the .NET MAUI Image Editor (SfImageEditor). Refer to our .NET MAUI ImageEditor’s feature tour page for other groundbreaking feature representations. You can also explore our .NET MAUI ImageEditor documentation to understand how to present and manipulate data. For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion, try our 30-day free trial to check out our .NET MAUI Image Editor and other .NET MAUI components. Please let us know in the following comment section if you have any queries or require clarifications. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!</imageeditor:sfimageeditor>
By default in SfImageEditor, the image will be saved in original image size and “.jpg” format. We can also able to change the image size and image format while saving the image. Step 1: Create SfImageEditor sample with all necessary assemblies. Please refer the below link to create a simple SfImageEditor sample along with the ways to configure it. https://help.syncfusion.com/xamarin/sfimageeditor/getting-started Step 2: Set width and height manually and change the image saving format while Saving the image using pop-ups Please refer the following code snippet to set image size and change image format while saving. C# private void Ok_Clicked(object sender, EventArgs e) { ... Size size = new Size(width, height); if(SaveFormat.SelectedIndex == 0) Editor.Save(".jpg", size); else if (SaveFormat.SelectedIndex == 1) Editor.Save(".png", size); else if (SaveFormat.SelectedIndex == 2) Editor.Save(".bmp", size); } In the below code snippet, calculated width and height while respecting aspect ratio and created picker for changing the image format and passed into save method. C# private void WidthValue_TextChanged(object sender, TextChangedEventArgs e) { heightValue.TextChanged -= HeightValue_TextChanged; Int32.TryParse(widthValue.Text, out width); int adjustedHeight = width * originalHeight / originalWidth; heightValue.Text = adjustedHeight.ToString(); heightValue.TextChanged += HeightValue_TextChanged; } private void HeightValue_TextChanged(object sender, TextChangedEventArgs e) { widthValue.TextChanged -= WidthValue_TextChanged; Int32.TryParse(heightValue.Text, out height); int adjustedWidth = height * originalWidth / originalHeight; widthValue.Text = adjustedWidth.ToString(); widthValue.TextChanged += WidthValue_TextChanged; } private void Ok_Clicked(object sender, EventArgs e) { popup.IsVisible = false; grid.IsVisible = false; Int32.TryParse(widthValue.Text, out width); Int32.TryParse(heightValue.Text, out height); Size size = new Size(width, height); if(SaveFormat.SelectedIndex==0) Editor.Save(".jpg", size); else if (SaveFormat.SelectedIndex == 1) Editor.Save(".png", size); else if (SaveFormat.SelectedIndex == 2) Editor.Save(".bmp", size); } Screen Shot: Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ImageEditor_GettingStarted-86887888.zip