using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApp3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen pen = new Pen(Color.Black, 2);
// корпус
g.DrawLine(pen, 100, 450, 700, 450);
g.DrawLine(pen, 100, 450, 200, 600);
g.DrawLine(pen, 700, 450, 650, 600);
g.DrawLine(pen, 200, 600, 650, 600);
// мачта
g.DrawLine(pen, 300, 450, 300, 0);
// парус
g.DrawLine(pen, 300, 100, 100, 400);
g.DrawLine(pen, 300, 100, 700, 400);
g.DrawLine(pen, 100, 400, 700, 400);
// флаг
g.DrawLine(pen, 300, 0, 400, 30);
g.DrawLine(pen, 400, 30, 300, 80);
g.DrawLine(pen, 300, 0, 300, 80);
}
}
}
using System;
using System.Windows.Forms;
namespace WindowsFormsApp3
{
internal static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}