渐变色,颜色由中心点向外扩散。效果不怎么好。

   Rect   rect(400, 30,  200, 200);
   GraphicsPath path;
   path.AddEllipse(rect);      // 构造一个路径 
   PathGradientBrush pthGrBrush(&path);                     // 使用路径构造一个画刷 

   pthGrBrush.SetCenterColor(Color(0, 0, 0));              // 将路径中心颜色设为黑色
   Color colors[] = {Color(255, 255, 255)};                     // 设置路径周围的颜色为白色
   INT count = 1;
   pthGrBrush.SetSurroundColors(colors, &count);
   gs.FillEllipse(&pthGrBrush, rect);

posted @ 2011-11-11 17:34  奥雷连诺  阅读(659)  评论(0编辑  收藏  举报