Tag Archives: drawing

Create oval images in C#

This example lets you create oval images with transparent backgrounds. It includes some features such as menus that let you load and save files. Download the example to see those details. The more interesting part is the code that creates … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , | Leave a comment

Draw a randomly colored Sierpinski octagon in C#

This example draws a randomly colored Sierpinski octagon. It’s basically the same as the example Draw a randomly colored Sierpinski pentagon in C# except it draws an octagon instead of a pentagon. See that example for most of the details. … Continue reading

Posted in algorithms, fractals, graphics, recursion | Tagged , , , , , , , , , , | Leave a comment

Let the user draw lines in C#

This example lets the user click and draw to draw lines. To make working with lines easier, the program uses the following Segment class. class Segment { public Pen Pen; public Point Point1, Point2; public Segment(Pen pen, Point point1, Point … Continue reading

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

Tile a board with colored trominoes in C#

The post Tile a board with trominoes in C# explains how to tile a board with a missing square with trominoes. This post shows how to color the trominoes so no two adjacent ones share the same color. The four-color … Continue reading

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

Tile a board with trominoes in C#

Trominoes are polyominoes of order three. That means they are polygons made up of three equal sized squares joined at their edges. There only are two kinds of trominoes: three squares joined in a line and three squares joined in … Continue reading

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

Draw a randomly colored Sierpinski pentagon in C#

The example Draw a colored Sierpinski pentagon in C# lets the user click on the parts of a Sierpinski pentagon to change their colors. Eddie Bole thought it would be interesting to color the larger pentagons in addition to the … Continue reading

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

Draw a colored Sierpinski pentagon in C#

The example Draw a Sierpinski pentagon in C# shows how to draw a Sierpinski pentagon. This example modifies that one so the user can click on pentagons to change their colors. To do that, this program takes a very different … Continue reading

Posted in drawing, fractals, graphics, recursion | Tagged , , , , , , , , , , | 6 Comments

Use label controls to draw a simple labeled histogram in C#

The example Draw a simple labeled histogram in C# draws a labeled histogram on a PictureBox in that control’s Paint event handler. It does a fair amount of work to ensure that the histogram’s bars are in their proper positions … Continue reading

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

Draw a simple labeled histogram in C#

The example Make a simple histogram in C# shows how to draw a simple histogram on a PictureBox. This example adds Label controls above the histogram’s bars. When the program loads, it uses the following code to generate some random … Continue reading

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

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