获取UWP XAML中的径向梯度
UWP XAML中的线性渐变效果很好,但我需要将其转换为径向渐变笔刷 这是我当前的UWP XAML代码获取UWP XAML中的径向梯度,xaml,uwp,Xaml,Uwp,UWP XAML中的线性渐变效果很好,但我需要将其转换为径向渐变笔刷 这是我当前的UWP XAML代码 <Page x:Class="button_radious.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using
<Page
x:Class="button_radious.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:button_radious"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
<Grid.Background>
<LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
<GradientStop Color="#000000" Offset="0.30"/>
<GradientStop Color="green" Offset="0.65"/>
<GradientStop Color="White" Offset="0.90"/>
</LinearGradientBrush>
</Grid.Background>
</Grid>
</Page>
默认情况下,RadialGradientBrush不包括在UWP API中。您将需要添加对的引用,其中包含可以按预期使用的内容,方法与在WPF中相同
<Grid>
<Grid.Background>
<media:RadialGradientBrush
AlphaMode="Premultiplied"
RadiusX="0.2" RadiusY="0.2"
SpreadMethod="Reflect">
<GradientStop Color="Red" Offset="0" />
<GradientStop Color="Transparent" Offset="0.25" />
<GradientStop Color="Yellow" Offset="0.50" />
<GradientStop Color="Transparent" Offset="0.75" />
<GradientStop Color="Green" Offset="1.0" />
</media:RadialGradientBrush>
</Grid.Fill>
</Grid>
你能在你的问题上再补充一些信息吗。例如,给定代码的作用以及代码的问题所在
xmlns:media="Microsoft.Toolkit.Uwp.UI.Media"