Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Tags: CSS,.Blue,.Red,.Gray,.Black, Created At: 10/24/2016 8:26:15 PMViews:

HTML view:
Copy Source | Copy HTML
  1. float x0 = 230;
  2. float y0 = 180;
  3. float t =  0;
  4. private void onPaint(object sender, PaintEventArgs e)
  5. {
  6.     Graphics g = e.Graphics; // Ð¡Ð¾Ñ…ранить Graphics
  7.     DrawSheep(g, x0, y0, t); // ÐÐ°Ñ€Ð¸ÑÐ¾Ð²Ð°Ñ‚ÑŒ Ð±Ð°Ñ€Ð°Ð½Ð°
  8. }
  9. void DrawSheep(Graphics g, float x0, float y0, float t)
  10. {
  11.     Pen p1 = new Pen(Color.Blue, 2); // Ð·Ð°Ð³Ð¾Ñ‚авливаем Ð¿ÐµÑ€ÑŒÑ Ð¸ ÐºÐ¸ÑÑ‚и
  12.     Pen p2 = new Pen(Color.Red, 3); // Ð´Ð»Ñ Ñ€Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð±Ð°Ñ€Ð°Ð½Ð°
  13.     Pen p3 = new Pen(Color.Gray, 4);
  14.     Pen p4 = new Pen(Color.Black, 3);
  15.     SolidBrush b1 = new SolidBrush(Color.Green);
  16.     g.FillEllipse(b1, x0, y0, 100, 50); // Ñ‚уловище
  17.     float xhead = x0 + 60; // Ð²Ñ‹Ñ‡Ð¸ÑÐ»ÑÐµÐ¼ ÐºÐ¾Ð¾Ñ€Ð´Ð¸Ð½Ð°Ñ‚Ñ‹ Ð³Ð¾Ð»Ð¾Ð²Ñ‹
  18.     float yhead = y0 - 20;
  19.     g.DrawPolygon(p1, new PointF[] { new PointF(xhead, yhead), new PointF(xhead + 30, yhead + 30),
  20.         new PointF(xhead + 60, yhead) }); // Ñ€Ð¸ÑÑƒÐµÐ¼ Ð³Ð¾Ð»Ð¾Ð²Ñƒ
  21.     g.DrawEllipse(p2, x0 + 80, y0 - 12, 5, 5); // Ñ€Ð¸ÑÑƒÐµÐ¼ Ð³Ð»Ð°Ð·Ð°
  22.     g.DrawEllipse(p2, x0 + 95, y0 - 12, 5, 5);
  23.     g.DrawArc(p3, x0 + 20, y0 - 45, 50, 50, 0, -90); // Ñ€Ð¸ÑÑƒÐµÐ¼ Ñ€Ð¾Ð³Ð°
  24.     g.DrawArc(p3, x0 + 60, y0 - 45, 50, 50, 0, -90);
  25.     float xlegs = x0 + 10; // Ð²Ñ‹Ñ‡Ð¸ÑÐ»ÑÐµÐ¼ ÐºÐ¾Ð¾Ñ€Ð´Ð¸Ð½Ð°Ñ‚Ñ‹ Ð½Ð¾Ð³
  26.     float ylegs = y0 + 42; // Ð¸ Ñ€Ð¸ÑÑƒÐµÐ¼ Ñ‡ÐµÑ‚ыре Ð½Ð¾Ð³Ð¸
  27.     g.DrawLines(p4, new PointF[] { new PointF(xlegs, ylegs), new PointF(xlegs + 20 * (1 - t), ylegs + 20), new PointF(xlegs, ylegs + 40) });
  28.     xlegs = xlegs + 20;
  29.     g.DrawLines(p4, new PointF[] { new PointF(xlegs, ylegs), new PointF(xlegs + 20 * (1 - t), ylegs + 20), new PointF(xlegs, ylegs + 40) });
  30.     xlegs = xlegs + 40;
  31.     g.DrawLines(p4, new PointF[] { new PointF(xlegs, ylegs), new PointF(xlegs + 20 * (1 - t), ylegs + 20), new PointF(xlegs, ylegs + 40) });
  32.     xlegs = xlegs + 20;
  33.     g.DrawLines(p4, new PointF[] { new PointF(xlegs, ylegs), new PointF(xlegs + 20 * (1 - t), ylegs + 20), new PointF(xlegs, ylegs + 40) });
  34.     g.DrawArc(p4, x0 - 25, y0 + 12, 25, 25, 0, 245); // Ñ€Ð¸ÑÑƒÐµÐ¼ Ñ…вост
  35. }

Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2017