Tag Archives: Polyline

Graph points in WPF and C#

This example extends the previous example Draw a graph in WPF and C# to draw ellipses marking the data sets’ points. See that example for an explanation of how most of the program works. The following code shows how the … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Render polygons and polylines in a WPF program using C#

WPF lets you do all sorts of interesting things that are much harder in Windows Forms applications. However sometimes, as in this example, it makes simple things much harder. (WPF’s slogan should be, “Twice as flexible and only five times … Continue reading

Posted in drawing, extension methods, geometry, graphics, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments

Let the user zoom on a picture in C#

The example Provide autosave in C# explains how to make a program that lets the user draw lines in different colors and styles. That program lets the user undo and redo, save and load drawings, and autosaves so it can … Continue reading

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

Provide autosave in C#

This example extends the scribble example (most recently described in the post Provide undo and redo in C#) so it provides an auto-save feature. The following code creates the name of the program’s auto-save file. // The auto-save file name. … Continue reading

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

Provide undo and redo in C#

This example adds undo and redo features to the example Save and restore pictures drawn by the user in C#. It’s not terribly hard, but it is long so I’ll break it into sections to make it easier to understand. … Continue reading

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

Save and restore pictures drawn by the user in C#

The example Let the user scribble with different line styles in C# explains how to let the user draw curves with different colors, line thicknesses, and dash patterns. This example adds the ability to save and load pictures drawn by … Continue reading

Posted in drawing, graphics, serialization | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , | 3 Comments

Let the user scribble with different line styles in C#

The example Let the user scribble on a PictureBox in C# explains how to let the user draw polylines, but the program only draws thin black curves. This example adds color, line thickness, and line styles such as dashed or … Continue reading

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

Let the user scribble on a PictureBox in C#

The Graphics class provides a DrawLines method that draws a series of connected lines, which is sometimes called a polyline. This program lets the user create a series of polylines. The program stores the points that make up a polyline … Continue reading

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

Zoom on a graph with XAML code in C#

This example shows how you can zoom on a graph with XAML code only, without using C# code. (The program does use C# code to build the graph. It just doesn’t use any to zoom.) The example Zoom in on … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Zoom on a graph in WPF and C#

It’s remarkably easy to zoom on a graph in WPF. This example extends the example Let the user click on graph points in WPF and C#. To modify the previous version, you first need to rebuild the user interface a … Continue reading

Posted in algorithms, drawing, geometry, graphics, mathematics | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 2 Comments