Пример #1
0
 private void BeziersBox_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (e.Button != MouseButtons.Left)
     {
         return;
     }
     newPoint.EndX = e.X;
     newPoint.EndY = e.Y;
     switch (newType)
     {
     case MainWindow.ImageType.Set:
         if (pointChange == false)
         {
             return;
         }
         newPoint.EndP.Offset(-2, -2);
         Rectangle r  = new Rectangle(newPoint.EndP, new Size(4, 4));
         Region    rr = new Region(r);
         regionCollection[beziersPoint] = rr;
         pointCollection[beziersPoint]  = newPoint.EndP;
         Point[] p     = MakePoints();
         Point   endp2 = newPoint.StartP;
         endp2.Offset(4, 4);
         pointList[beziersPoint]  = new DHollowRectangle(new Point[] { newPoint.EndP, endp2 }, Color.DarkRed, 1);
         beziersList[BezierIndex] = new DBeziers(p, Color.Black, 1);
         break;
     }
     BeziersBox.Invalidate();
 }
 private void BeziersBox_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
 {
     if (e.Button != MouseButtons.Left)
         return;
     newPoint.EndX = e.X;
     newPoint.EndY = e.Y;
     switch(newType)
     {
         case MainWindow.ImageType.Set:
             if(pointChange ==false)
                 return;
             newPoint.EndP.Offset(-2,-2);
             Rectangle r = new Rectangle(newPoint.EndP,new Size(4,4));
             Region rr = new Region(r);
             regionCollection[beziersPoint]=rr;
             pointCollection[beziersPoint]=newPoint.EndP;
             Point[] p = MakePoints();
             Point endp2 = newPoint.StartP;
             endp2.Offset(4,4);
             pointList[beziersPoint] = new DHollowRectangle(new Point[]{newPoint.EndP,endp2},Color.DarkRed, 1);
             beziersList[BezierIndex] = new DBeziers(p,Color.Black,1);
             break;
     }
     BeziersBox.Invalidate();
 }