19,500
社区成员
发帖
与我相关
我的任务
分享
//画方块
public void Draw(System.IntPtr winHandle)
{
Graphics g = Graphics.FromHwnd(winHandle);
GraphicsPath gp = new GraphicsPath();
Rectangle rec = new Rectangle(location, size);
gp.AddRectangle(rec);
Color[] surroundColor = new Color[] { backColor };
PathGradientBrush pb = new PathGradientBrush(gp);
pb.CenterColor = foreColor;
pb.SurroundColors = surroundColor;
g.FillPath(pb, gp);
}