using(Graphics graphics = This. CreateGraphics ()) {graphics. Clear (Color.White); Point[] Points= {//Clockwise Point coordinates NewPoint ( the,0),NewPoint ( -, -), NewPoint ( the, -),NewPoint ( the, -), NewPoint ( the, the),NewPoint ( the, -), NewPoint ( -, the),NewPoint ( -, -), NewPoint (0, -),NewPoint ( -, -), NewPoint ( the,0) }; //Create PathGraphicsPath Path =NewGraphicsPath (); //add a line in a pathpath. AddLines (points); //Create a path gradient paint brushPathGradientBrush PGB =NewPathGradientBrush (path); //Set Center point color (end color)Pgb. Centercolor =color.red; //set the color of each endpoint (end color)//set the edge color of the path gradient brushPgb. Surroundcolors =Newcolor[] {color.aqua, Color.green, Color.pink, Color.White, Color.yell ow, Color.green, Color.Blue, Color.silver, Color.Black, color.green}; //Fill Target PathGraphics. FillPath (PGB, path); Path. Dispose (); Pgb. Dispose (); }
Draw colorful Pentagram