Liquid Glass Effect in .NET MAUI Image Editor (SfImageEditor)
21 Jul 20264 minutes to read
The Liquid Glass Effect introduces a modern, translucent design with adaptive color tinting and light refraction, creating a sleek, glass-like user experience that remains clear and accessible. This section explains how to enable and customize the effect in the SfImageEditor control.
Apply liquid glass effect
Follow these steps to enable and configure the Liquid Glass Effect in the Image Editor control:
Step 1: Wrap the control inside a glass effect view
To apply the Liquid Glass Effect to the SfImageEditor control, wrap it inside the SfGlassEffectView class.
For more details, refer to the Liquid Glass Getting Started documentation.
Step 2: Enable the liquid glass effect on the Image Editor
Set the EnableLiquidGlassEffect property to true in the SfImageEditor control to apply the Liquid Glass Effect. When enabled, the effect is also applied to its dependent controls and provides responsive interaction for a smooth and engaging user experience.
Step 3: Customize the background
To achieve a glass-like background in the Image Editor and its Toolbar control, set the Background property to Transparent. The background will then be treated as a tinted color, ensuring a consistent glass effect across the controls.
The following code snippet demonstrates how to apply the Liquid Glass Effect to the SfImageEditor control:
<Grid BackgroundColor="Transparent">
<core:SfGlassEffectView EffectType="Regular"
CornerRadius="20">
<imageEditor:SfImageEditor x:Name="imageEditor"
Background="Transparent"
SelectionStroke="#AE97FF"
Source="editorimage.png"
EnableLiquidGlassEffect="True">
<imageEditor:SfImageEditor.ToolbarSettings>
<imageEditor:ImageEditorToolbarSettings Background="Transparent"
Stroke="Transparent" />
</imageEditor:SfImageEditor.ToolbarSettings>
</imageEditor:SfImageEditor>
</core:SfGlassEffectView>
</Grid>using Microsoft.Maui.Graphics;
using Syncfusion.Maui.Core;
using Syncfusion.Maui.ImageEditor;
var grid = new Grid
{
BackgroundColor = Colors.Transparent
};
var glassView = new SfGlassEffectView
{
CornerRadius = 20,
EffectType = LiquidGlassEffectType.Regular
};
var imageEditor = new SfImageEditor
{
Background = Colors.Transparent,
EnableLiquidGlassEffect = true,
SelectionStroke = Color.FromArgb("#AE97FF"),
Source = ImageSource.FromFile("editorimage.png"),
EnableLiquidGlassEffect = true,
ToolbarSettings = new ImageEditorToolbarSettings
{
Background = Colors.Transparent,
Stroke = Colors.Transparent
}
};
glassView.Content = this.imageEditor;
grid.Children.Add(glassView);
this.Content = grid;NOTE
- Supported on
macOS 26 or higherandiOS 26 or higher.- This feature is available only in
.NET 10.