扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:coffer编译 来源:VCKBASE 2007年11月16日
关键字:
public: LinearGradientBrush(Point point1, Point point2, Color color1, Color color2); public: LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2); |
private: System::Void Form1_Paint(System::Object * sender, System::Windows::Forms::PaintEventArgs * e) { using namespace System::Drawing::Drawing2D; LinearGradientBrush *lgb = new LinearGradientBrush(Point(20, 20), Point(450,20), Color::DarkGreen, Color::LightBlue); e->Graphics->FillRectangle(lgb, 20, 20, 430, 180); } |
![]() 图十一、线性渐变画刷效果 |
public: LinearGradientBrush(Rectangle rect, Color color1, Color color2, LinearGradientMode factor); public: LinearGradientBrush(RectangleF rect, Color color1, Color color2, LinearGradientMode factor); |
private: System::Void Form1_Paint(System::Object * sender, System::Windows::Forms::PaintEventArgs * e) { using namespace System::Drawing::Drawing2D; Rectangle rect(10, 10, 470, 300); LinearGradientBrush *lgb = new LinearGradientBrush(rect, Color::DarkRed,Color::White, LinearGradientMode::Vertical); e->Graphics->FillRectangle(lgb, 10, 10, 450, 280); } |
![]() 图十二、代码运行效果图 |
public: LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle); public: LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle); |
private: System::Void Form1_Paint(System::Object * sender, System::Windows::Forms::PaintEventArgs * e) { using namespace System::Drawing::Drawing2D; Rectangle rect(10, 10, 470, 300); LinearGradientBrush *lgb = new LinearGradientBrush(rect, Color::DarkRed, Color::White, -65.24F); e->Graphics->FillRectangle(lgb, 10, 10, 450, 280); } |
![]() 图十三、代码运行效果图 |
public: PathGradientBrush(Point points[]); public: PathGradientBrush(PointF points[]); |
private: System::Void Form1_Paint(System::Object * sender, System::Windows::Forms::PaintEventArgs * e) { using namespace System::Drawing::Drawing2D; Point ptGraph[] = { Point(10, 10), Point(450, 10), Point(450, 250), Point(10, 250) }; PathGradientBrush *pgb = new PathGradientBrush(ptGraph); e->Graphics->FillRectangle(pgb, 10, 10, 450, 280); } |
![]() 图十四、代码运行效果图 |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者