How to read the color from an offset of a XAML LinearGradientBrush?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Given a LinearGradientBrush defined as follows: <LinearGradientBrush x:Key="RedYellowGradient"> <GradientStop Color="Blue" Offset="0.01" /> <GradientStop Color="Purple" Offset="0.25"/> <GradientStop Color="Red" Offset="0.5"/> <GradientStop Color="Orange" Offset="0.75"/> <GradientStop Color="Yellow" Offset="1.0"/> </LinearGradientBrush> What is required to take that definition and determine the color represented by a specific offset, such as 0.13 or 0.82 without rendering anything visible? This would take the form of a function with a