I have draw a rectangle as:
Rectangle rectangle=new Rectangle(10,10,40,40);
g.FillRectangle(new SolidBrush(Color.Red),rectangle);
can somebody give me any idea that is it possible to get the background color of a rectangle when clicked:
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
if (rectangle.Contains(e.Location))
{
//get the color here that it should be Red
Console.WriteLine("COLOR IS: " ????);
}
}
Thanks in advance