The following code snippet only returns in grayscale. I have been troubled by this for the majority of the day. Any thoughts on the reason why?
using System.Drawing;
private Graphics _g;
public Form1()
{
InitializeComponent();
_g = pictureBox1.CreateGraphics();
}
private void x()
{
System.Drawing.Rectangle r = CreateCircle(e);
SolidBrush brsh = ChooseFillColor();
_g.FillEllipse(brsh, r);
}
private SolidBrush ChooseFillColor()
{
return new SolidBrush(Color.FromArgb(RandomNumber(255), RandomNumber(255), RandomNumber(255)));
}
private int RandomNumber(int max)
{
Random random = new Random();
return random.Next(max);
}