相关疑难解决方法(0)

在渐变上获取特定位置的颜色

我有以下内容GradientStopCollection:

GradientStopCollection grsc = new GradientStopCollection(3);
grsc.Add(new GradientStop(Colors.Red, 0));
grsc.Add(new GradientStop(Colors.Yellow, .5));
grsc.Add(new GradientStop(Colors.Green, 1));
Run Code Online (Sandbox Code Playgroud)

我可以在特定的"位置"获得颜色吗?例如:

  • 位置0:红色
  • 位置.5:黄色
  • 位置.75: Yellow<~>Green

WPF/某些第三方库中是否有API 可以做到这一点?

.net c# xaml lineargradientbrush

13
推荐指数
1
解决办法
5683
查看次数

标签 统计

.net ×1

c# ×1

lineargradientbrush ×1

xaml ×1