Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Security.AccessControl;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace SCR_Football
- {
- public partial class Form1 : Form
- {
- private const int playerRadius = 50;
- Pen whitePen = new Pen(Color.White, 3);
- Brush grass = new SolidBrush(Color.DarkOliveGreen); // texturebrush?
- private readonly System.Drawing.Graphics fieldGraphics;
- public Form1()
- {
- InitializeComponent();
- fieldGraphics = fieldPictureBox.CreateGraphics();
- this.FormBorderStyle = FormBorderStyle.FixedDialog;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- DrawField();
- }
- private void DrawField()
- {
- Point[] fieldPoints = new Point[]
- {
- new Point(0, 50),
- new Point(150, 50),
- new Point(150, 0),
- new Point(250, 0),
- new Point(250, 50),
- new Point(400, 50),
- new Point(400, 550),
- new Point(250, 550),
- new Point(250, 600),
- new Point(150, 600),
- new Point(150, 550),
- new Point(0, 550)
- };
- fieldGraphics.FillPolygon(grass, fieldPoints);
- fieldGraphics.DrawPolygon(whitePen, fieldPoints);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement