<Window x:Class="WpfApp92.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApp92" WindowState="Maximized" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Ellipse Grid.Column="0"> <Ellipse.Fill> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientStop Offset="0.0" Color="Blue"/> <GradientStop Offset="1.0" Color="Red"/> </LinearGradientBrush> </Ellipse.Fill> </Ellipse> <Ellipse Grid.Column="1"> <Ellipse.Fill> <LinearGradientBrush StartPoint="0,1" EndPoint="0,0"> <GradientStop Offset="0.0" Color="Blue"/> <GradientStop Offset="1.0" Color="Red"/> </LinearGradientBrush> </Ellipse.Fill> </Ellipse> <Ellipse Grid.Column="2"> <Ellipse.Fill> <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> <GradientStop Offset="0.0" Color="Blue"/> <GradientStop Offset="1.0" Color="Red"/> </LinearGradientBrush> </Ellipse.Fill> </Ellipse> <Ellipse Grid.Column="3"> <Ellipse.Fill> <LinearGradientBrush StartPoint="0.5,0" EndPoint="1,0"> <GradientStop Offset="0.0" Color="Blue"/> <GradientStop Offset="1.0" Color="Red"/> </LinearGradientBrush> </Ellipse.Fill> </Ellipse> <Ellipse Grid.Column="4"> <Ellipse.Fill> <LinearGradientBrush StartPoint="-2,2" EndPoint="2,2"> <GradientStop Offset="0.0" Color="Blue"/> <GradientStop Offset="1.0" Color="Red"/> </LinearGradientBrush> </Ellipse.Fill> </Ellipse> </Grid> </Window>
标签:WPF,EndPoint,StartPoint,LinearGradientBrush From: https://www.cnblogs.com/Fred1987/p/18622626