WinForms中的多色线性渐变
如何在WinForms中创建多色线性渐变? System.Drawing.Drawing2D.LinearGradientBrush 仅允许两种颜色。
How to create multi-color linear gradient in WinForms? System.Drawing.Drawing2D.LinearGradientBrush allows only two colors.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
与这里的答案相同:Multi-color对角线渐变在winformsMulti-color对角线渐变在winforms
是一个小例子
这里 结果
希望这有帮助
same answer as here: Multi-color diagonal gradient in winforms Multi-color diagonal gradient in winforms
Here is a little example
here is the result
hope this helps
我创建了一个面板,因为我可以将其用作我的项目的容器。代码非常简单,就是如果你想实现 Punker76 提供的不停止。
拥有控件可以使重用更加高效。请记住,在控件中进行更改时,您可能需要重新构建项目才能看到更改生效。
I have created a panel as I can use this as container for my project. The code is really simple, that is if you want to implement no stops as provided by Punker76.
Having a control makes re-use so much more efficient. Remember, you may need to re-build your project before you see the changes take effect when you make changes in the control.