Tag Archives: using

Remove unnecessary using directives in C#

The top of a C# code file usually includes series of using directives to tell Visual Studio which namespaces are used by the code. When you first create a project, the code files include lots of using directives that might … Continue reading

Posted in coding, performance | Tagged , , , , , , , , , | Leave a comment

Fill a polygon with a PathGradientBrush in C#

A PathGradientBrush defines a brush that shades smoothly from a “center point” to specific points along a path. This example fills a hexagon with colors that shade from white in the center to red, yellow, lime, cyan, blue, and magenta … Continue reading

Posted in graphics | Tagged , , , , , , , , , , , , , | 2 Comments

Use a LinearGradientBrush in C#

A LinearGradientBrush fills an area with a color gradient that blends smoothly from one color to another. The LinearGradientBrush class has a Dispose method that you should call when you’re done with the brush. To make that easier, place the … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , | 2 Comments