[英]WPF background colors
I would like to create some colors as my WPF background, but I have 2 issues with that:我想创建一些颜色作为我的 WPF 背景,但我有两个问题:
But the problem is: When I create a gradient in WPF, color changes are kind of blurred.但问题是:当我在 WPF 中创建渐变时,颜色变化有点模糊。
I have tried to do it that way :我试图这样做:
<Window.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="#70116B" Offset="0" />
<GradientStop Color="#70116B" Offset="0.4" />
<GradientStop Color="#BBD909" Offset="0.4" />
<GradientStop Color="#BBD909" Offset="0.5" />
<GradientStop Color="#0093DD" Offset="0.5" />
<GradientStop Color="#0093DD" Offset="0.52" />
<GradientStop Color="White" Offset="0.52" />
<GradientStop Color="White" Offset="1" />
</LinearGradientBrush>
</Window.Background>
But like I said: it's not what I want但就像我说的:这不是我想要的
What you want to achieve isn't a gradient.您想要实现的不是渐变。 But i would suggest you to use something like below:但我建议您使用以下内容:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.4*"/>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="0.02*"/>
<ColumnDefinition Width="0.48*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Background="#70116B"/>
<Grid Grid.Column="1" Background="#BBD909"/>
<Grid Grid.Column="2" Background="#0093DD"/>
<Grid Grid.Column="3" Background="#FFFFFF"/>
</Grid>
Hope this helps!希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.