Tag Archives: DrawCurve

Let the user draw a smooth curve in C#

This example lets the user click points to draw a smooth curve. When the user clicks the left mouse button, the program adds a point to the curve. When the user clicks the right button, the program stops drawing the … Continue reading

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

See if the mouse is over a curve in C#

The post Draw a smooth curve connecting points in C# uses the Graphics class’s DrawCurve method to draw a smooth curve that connects a collection of points. This example shows how you can tell when the mouse is over the … Continue reading

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

Draw a curve with more sharply delineated colors in C#

In the post Draw a curve with sharply delineated colors in C# I mentioned that you could achieve even more sharply defined colors if you use a TextureBrush. Naturally I couldn’t let it reset so here’s an example that does … Continue reading

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

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 a curve with negative tension in C#

The post Draw a curve with varying tensions in C# uses the Graphics class’s DrawCurve method to draw a set of curves with different tensions. While experimenting with that example, I tried drawing a curve with a negative tension, fully … Continue reading

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

Draw a curve with varying tensions in C#

The example Change tension for a smooth curve in C# shows how to use the Graphics class’s DrawCurve draw method to draw a smooth curve connecting a sequence of points. The method’s tension parameter lets you change how directly the … Continue reading

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

Change tension for a smooth curve in C#

The post Draw a smooth curve connecting points in C# explains how you can use the Graphics class’s DrawCurve method to draw a smooth curve that connects a sequence of points. It uses the following code. e.Graphics.DrawCurve(Pens.Red, Points.ToArray()); This example … Continue reading

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

Draw a smooth curve connecting points in C#

The Graphics class’s DrawCurve method draws a smooth curve connecting a sequence of points. The type of curve drawn is called a spline. In general, a spline is a smooth curve with a shape determined by a collection of control … Continue reading

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