扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:刘涛编译 来源:天极网 2007年11月16日
关键字:
![]() 图五、直线示意图 |
public: void DrawLine(Pen *pen, Point pt1, Point pt2); public: void DrawLine(Pen *pen, PointF pt1, PointF pt2); public: void DrawLine(Pen *pen, int x1, int y1, int x2, int y2); public: void DrawLine(Pen *pen, float x1, float y1, float x2, float y2); |
private: System::Void Form1_Paint(System::Object * sender, System::Windows::Forms::PaintEventArgs * e) { Pen *penCurrent = new Pen(Color::Red); e->Graphics->DrawLine(penCurrent, 20, 20, 205, 20); penCurrent = new Pen(Color::Green); e->Graphics->DrawLine(penCurrent, 40, 40, 225, 40); penCurrent = new Pen(Color::Blue); e->Graphics->DrawLine(penCurrent, 30, 60, 215, 60); } |
![]() 图六:绘制三条直线 |
public: void DrawLines(Pen *pen, Point points[]); public: void DrawLines(Pen *pen, PointF points[]); |
private: System::Void Form1_Paint(System::Object * sender, System::Windows::Forms::PaintEventArgs * e) { Point Coordinates[] = { Point(20, 10), Point(205, 20), Point(40, 40), Point(225, 60), Point(30, 80), Point(215, 100) }; Pen *penCurrent = new Pen(Color::Red); e->Graphics->DrawLines(penCurrent, Coordinates); } |
![]() 图七、系列直线效果图 |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。