我尝试了一些方法,但唯一的方法是在github上安装和使用它们。有没有办法简单地在xaml文件中模糊化?例如我想模糊网格背景。这可能吗?
mum43rcc1#
Xamarin中没有内置模糊效果。您需要额外的工具SkiaSharp或Sharpnado。StackOverflow相关问题:Make current screen into BLUR on Xamarin.forms另一种方法是创建自己的控件:https://www.c-sharpcorner.com/article/how-to-create-and-use-a-blurred-image-in-xamarin-forms/
cgyqldqp2#
<Grid> <Image Source="image.jpg" Aspect="AspectFill" /> <BoxView Color="#80000000" /> <controls:Blur BlurType="Gaussian" BlurAmount="12" /> ----> Rest of your code here <---- </Grid>
6qfn3psc3#
是的,你可以使用SkiaSharp image filters。你可以参考这个文档关于模糊矢量图形和位图。
public static SkiaSharp.SKImageFilter CreateBlur (float sigmaX, float sigmaY, SKImageFilter input = null, SKImageFilter.CropRect cropRect = null);
3条答案
按热度按时间mum43rcc1#
Xamarin中没有内置模糊效果。您需要额外的工具SkiaSharp或Sharpnado。StackOverflow相关问题:
Make current screen into BLUR on Xamarin.forms
另一种方法是创建自己的控件:
https://www.c-sharpcorner.com/article/how-to-create-and-use-a-blurred-image-in-xamarin-forms/
cgyqldqp2#
6qfn3psc3#
是的,你可以使用SkiaSharp image filters。你可以参考这个文档关于模糊矢量图形和位图。