SHARE
TWEET

Untitled

a guest Jun 26th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.        private void DrawBezier(Point pt, int length)
  2.         {
  3.             // gorna linia
  4.             Point pt1 = new Point { X = pt.X - 25, Y = pt.Y };
  5.             Point pt2 = new Point { X = pt.X - 5, Y = pt.Y };
  6.             dc.DrawLine(pen, pt1, pt2);
  7.  
  8.             //dolna linia
  9.             Point pt3 = new Point { X = pt.X - 25, Y = pt.Y + length };
  10.             Point pt4 = new Point { X = pt.X - 5, Y = pt.Y + length };
  11.             dc.DrawLine(pen, pt3, pt4);
  12.  
  13.             //krzywa (brzuszek)
  14.             Point pt5 = new Point { X = pt1.X - (length / 2), Y = (((pt1.Y + pt3.Y) / 2) + pt1.Y) / 2 };
  15.             Point pt6 = new Point { X = pt3.X - (length / 2), Y = (((pt1.Y + pt3.Y) / 2) + pt3.Y) / 2 };
  16.             Point start = pt1;
  17.             foreach (Point p in GetBezierPoints(pt1, pt5, pt6, pt3))
  18.             {
  19.                 dc.DrawLine(pen, start, p);
  20.                 start = p;
  21.             }
  22.  
  23.             //przekreƛlenie
  24.             dc.DrawLine(pen, new Point { X = pt2.X - 5, Y = pt2.Y - 5 }, new Point { X = pt3.X + 5, Y = pt3.Y + 5 });
  25.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top