using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.ProgressBar;
namespace OOP
{
public partial class Form1: Form
{
int count = 0;
Random r = new Random(1);
int[] ar;
public Form1()
{
InitializeComponent();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
this.Text = count++.ToString();
Color clr = Color.FromArgb(10, 50, 75, 250);
int x1 = 400;
int y1 = 300;
int x2, y2;
for (int i = 0; i < 100; i++)
{
SolidBrush solidBrush = new SolidBrush(clr);
x2 = x1 + ar[i * 5 + 3];
y2 = y1 + ar[i * 5 + 4];
e.Graphics.FillRectangle(solidBrush, new Rectangle(100, 100, 200, 150));
x1 = x2;
y1 = y2;
}
}
private void Form1_Load(object sender, EventArgs e)
{
ar = new int[500];
for (int i = 0; i < 100; i++)
{
ar[i * 5] = r.Next(256);
ar[i * 5 + 1] = r.Next(256);
ar[i * 5 + 2] = r.Next(256);
ar[i * 5 + 3] = r.Next(-100, 100);
ar[i * 5 + 4] = r.Next(-100, 100);
}
}
}
}
// нужно сделать мазки другой кистью https://learn.microsoft.com/ru-ru/dotnet/api/System.Drawing.Brush?view=windowsdesktop-7.0