Circular Gradient and WPF

為{幸葍}努か 提交于 2020-01-04 05:21:37

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/1187597/circular-gradient-and-wpf

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!