Tag Archives: brushes

Make a rotating brush in C#

This example draws a background filled with a rotating brush. It then draws text over the background. When it starts the program uses the following code to create points that define a regular polygon. // The polygon’s points. private PointF[] … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , | Leave a comment

List colors in WPF and C#

This example shows how to list colors and display color samples in a WPF ListBox. To build the list, the example demonstrates reflection, LINQ, and XAML data templates. The program uses the following XAML code to define the ListBox that … Continue reading

Posted in drawing, enums, graphics, LINQ, reflection, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Draw rainbow text in C#

This program’s Paint event handler uses the Graphics object’s DrawString method to draw some rainbow text. The brush it uses to draw the text is a LinearGradientBrush filled with a rainbow of colors. The trickiest part is figuring out exactly … Continue reading

Posted in drawing, fonts, graphics, strings | Tagged , , , , , , , , , , , , , , , , | Leave a comment