4,816
社区成员
发帖
与我相关
我的任务
分享
Graphics g = this.CreateGraphics();
//矩形区域
GraphicsPath path = new GraphicsPath();
path.AddRectangle(new Rectangle(0, 0, 200, 100));
//径向渐变刷
PathGradientBrush brush = new PathGradientBrush(path);
//中心颜色;
brush.CenterColor = Color.Red;
//边缘颜色;
brush.SurroundColors = new Color[] { Color.White };
g.FillPath(brush, path);