1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| void DrawCurvePointF( PaintEventArgs^ e )
{
// Create pens.
Pen^ redPen = gcnew Pen( Color::Blue,3.0f );
Pen^ greenPen = gcnew Pen( Color::Green,3.0f );
// Create points that define curve.
PointF point1 = PointF(0.0F,0.0F);
PointF point2 = PointF(60.0F,60.0F);
PointF point3 = PointF(120.0F,100.0F);
PointF point4 = PointF(150.0F,150.0F);
PointF point5 = PointF(189.0F,130.0F);
PointF point6 = PointF(200.0F,100.0F);
PointF point7 = PointF(250.0F,110.0F);
PointF point8 = PointF(230.0F,170.0F);
PointF point9 = PointF(150.0F,190.0F);
PointF point10 = PointF(100.0F,211.0F);
array<PointF>^ curvePoints = {point1,point2,point3,point4,point5,point6,point7,point8,point9,point10};
// Draw lines between original points to screen.
e->Graphics->DrawLines( redPen, curvePoints );
}
System::Void pictureBox2_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {
DrawCurvePointF(e);
} |
Partager