I want to draw lines ( about 100 ) with different colors. The lines will draw in a loop and get random colors. Here is my code:
for( int i = 0; i < 100 < i++ )
{
srand( time(NULL) );
int index = rand() % 99;
Pen^ my_pen = gcnew Pen((Color)CustomColorTables[index]);
g->drawLine(my_pen,startPointAray[i],stopPointArray[i]);
}
But it draws all lines with the same color???
Note: I checked the random values, there is no problem about generating random values.