圆形渐变和 WPF
我需要在 WPF 中从 Photoshop 合成复制圆形(或角度)渐变; 到目前为止我只能找到线性和径向。 有谁知道这样的事情是否存在,或者在 WPF 中获得圆形渐变的简单方法?
注意:我不是在问径向渐变。 圆形渐变就像取一个矩形,应用渐变,然后将矩形转换为圆形。
I need to replicate a circular (or angle) gradient from a Photoshop comp in WPF; so far I can only find linear and radial. Does anyone know if such a thing exists, or and easy way to get get a circular gradient in WPF?
Note: I'm not asking about a radial gradient. A circular gradient is like taking a rectangle, applying a gradient and then transforming the rectangle into a circle.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查此问题了解新的和这个问题的更完整的答案。
Check this question for a new and a bit more complete answer to this question.
虽然我以前从未这样做过(所以我不知道涉及什么),但您可以实现一个继承自
GradientBrush
。 但我认为这并不是小事。我也没有使用过 Photoshop 圆形渐变,但从你的描述来看,我忍不住认为你至少可以使用
LinearGradientBrush
然后转换结果 - 可能使用MatrixTransform
。抱歉,我无法给您具体的答案,但也许这些建议可以为您指明正确的方向。
While I've never done this before (so I don't know what's involved) you could implement a type that inherits from
GradientBrush
. I don't think this is trivial though.I've also not worked with Photoshop circular gradients, but from your description I can't help but think that you could at least approximate it using a
LinearGradientBrush
and then transforming the result - perhaps using aMatrixTransform
.Sorry that I can't give you concrete answers, but maybe these suggestions can point you in the right direction.