【发布时间】:2010-10-23 20:49:31
【问题描述】:
我开始玩 WPF,想在表单上绘制 color wheel。
起初我尝试像这样在 ArcSegment 上使用 LinearGradientBrush:
<Path StrokeThickness="35" Height="150" Width="150">
<Path.Stroke>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="Red" Offset="0.15" />
<GradientStop Color="Orange" Offset="0.2" />
<GradientStop Color="Yellow" Offset="0.35" />
<GradientStop Color="Green" Offset="0.5" />
<GradientStop Color="Blue" Offset="0.65" />
<GradientStop Color="Indigo" Offset="0.75" />
<GradientStop Color="Violet" Offset="0.9" />
</LinearGradientBrush>
</Path.Stroke>
<Path.Data>
<PathGeometry >
<PathFigure IsClosed="True" StartPoint="25,70">
<ArcSegment Point="25,71" IsLargeArc="True"
Size="50,50" SweepDirection="Clockwise" />
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
不成功,因为渐变仍然是水平的。
另一个想法是在应用渐变后我必须以某种方式弯曲线条。但我找不到合适的变换。
如果没有标准转换,是否可以进行自定义转换?还是应该按像素画色轮?
任何想法,请。
【问题讨论】:
标签: wpf transform gradient color-wheel