中国开发网: 论坛: 程序员情感CBD: 贴子 490899
周星驰
look again
using (Graphics g = Graphics.FromHwnd(this.Handle))
{
g.SmoothingMode = SmoothingMode.HighQuality;
using (GraphicsPath path = new GraphicsPath(FillMode.Alternate))
{
path.AddLine(e.X - 40, e.Y - 40, e.X - 40, e.Y + 40);
path.AddCurve(new Point[] { new Point( e.X - 40, e.Y + 40 ), new Point( e.X - 20, e.Y + 80 ), new Point( e.X + 40, e.Y + 40 ) });
path.AddLine(e.X + 40, e.Y + 40, e.X + 40, e.Y - 40);
path.AddLine(e.X + 40, e.Y - 40, e.X - 40, e.Y - 40);
using (LinearGradientBrush br = new LinearGradientBrush(Rectangle.FromLTRB(e.X - 40, e.Y - 40, e.X + 40, e.Y + 80), Color.Red, Color.Pink, LinearGradientMode.Vertical))
{
g.FillPath(br, path);
}
}
}


相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录