ArrayList Mylist = new ArrayList();
public Form1()
{
InitializeComponent();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
private void pictureBox1_MouseClick(object sender, MouseEventArgs e)
{
Random r=new Random();
int rNumber=r.Next(0,100);
int c=rNumber;
Color[] colors = { Color.Yellow, Color.Red, Color.Black, Color.Green, Color.Gold, Color.Gray, Color.Orange, Color.Pink, Color.Purple };
Color co = colors[r.Next(0, 9)];
Pen pen1 = new Pen(co);
Point p1 = new Point(e.X,e.Y);
Brush brush1=new SolidBrush(co);
Class1 mround = new Class1(p1,c,pen1,brush1);
Mylist.Add(p1);
Mylist.Add(c);
Mylist.Add(pen1);
Mylist.Add(brush1);
Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
pictureBox1.BackgroundImage = bmp;
Graphics g = Graphics.FromImage(bmp);
g.Clear(pictureBox1.BackColor);
mround.Draw(g);
}