Tag Archives: LinearGradientBrush

Draw a curve with sharply delineated colors in C#

The post Draw a curve with multiple colors in C# shows how you can draw a curve that shades gradually from one color to another as the curve’s Y coordinates change. However, you might not always want the colors to … Continue reading

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

Draw a curve with multiple colors in C#

It’s easy enough to draw different lines with different colors but it’s not as easy to draw a single line that uses multiple colors. One way to accomplish that is to make a LinearGradientBrush that defines the colors that you … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , , , , , , | 1 Comment

Draw an ellipse that sort of looks like a button in C#

This example uses two LinearGradientBrushes to draw an ellipse that has a sort of three-dimensional button-like appearance. The key is to outline the ellipse and then fill it with brushes whose gradients point in opposite directions. The following code shows … Continue reading

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

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