在GDI和WinForms C#径向渐变效果刷 [英] c# radial gradient brush effect in GDI and winforms

查看:1032
本文介绍了在GDI和WinForms C#径向渐变效果刷的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个C#Windows应用程序编写的代码的75%。该程序允许用户创建的流程图,并且将遮阳根据其情况的流程图的形状。我希望他们成为的3D按钮,如从网站的 Webdesign.org

I have created a c# windows application and written 75% of the code. The program allows the user to create a flow chart, and will shade the flow chart shapes according to their status. I wanted them to become 3d buttons such as from the website Webdesign.org

而不是为每个按钮创建一个PNG ,我想在C#创建它们用刷子或其它技术,如:

Rather than create a PNG for each button, I wanted to create them in C# using brushes or other technique, such as:

// Create solid brush.
SolidBrush blueBrush = new SolidBrush(Color.Blue);
// Create points that define polygon.
PointF point1 = new PointF(50.0F, 50.0F);
PointF point2 = new PointF(100.0F, 25.0F);
PointF point3 = new PointF(200.0F, 5.0F);
PointF point4 = new PointF(250.0F, 50.0F);
PointF point5 = new PointF(300.0F, 100.0F);
PointF point6 = new PointF(350.0F, 200.0F);
PointF point7 = new PointF(250.0F, 250.0F);
PointF[] curvePoints = {point1, point2, point3, point4, point5, point6, point7};
// Define fill mode.
FillMode newFillMode = FillMode.Winding;
// Fill polygon to screen.
e.Graphics.FillPolygon(blueBrush, curvePoints, newFillMode);



我知道WPF具有径向渐变,但我可以做一些simular在CGI?

I know WPF has radial gradients, but can I do something simular in CGI?

推荐答案

在这个看一看的 CodeProject上文章,然后在路径梯度。

Take a look at this Codeproject article, and then at the Path gradient.

这篇关于在GDI和WinForms C#径向渐变效果刷的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆