Circular Gradient and WPF

2019-07-13 11:51发布

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.

标签: wpf gradient psd
2条回答
别忘想泡老子
2楼-- · 2019-07-13 12:28

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 a MatrixTransform.

Sorry that I can't give you concrete answers, but maybe these suggestions can point you in the right direction.

查看更多
叛逆
3楼-- · 2019-07-13 12:31

Check this question for a new and a bit more complete answer to this question.

查看更多
登录 后发表回答