Tag Archives: drawing

Draw the spiral of Theodorus in C#

The spiral of Theodorus (which is also called the square root spiral, Einstein spiral, and Pythagorean spiral) was first devised by the Greek mathematician Theodorus of Cyrene during the 5th century BC. The spiral consists of a sequence of right … Continue reading

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

Draw a Pythagoras tree fractal in C#

A Pythagoras tree (or Pythagorean tree) is a fractal tree built from squares. It starts with a square that forms the tree’s base. The program then makes the Pythagoras tree by recursively attaching two smaller branches to the original branch. … Continue reading

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

Draw a Sierpinski pentagon in C#

In a Sierpinski pentagon, larger pentagons are recursively divided into five smaller pentagons with a sixth uncolored pentagon in the center. The following picture shows the first four levels of the resulting fractal. For this example, I decided to think … Continue reading

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

Use an animated cursor in C#

This example doesn’t show how to use an animated cursor file such as an animated gif or png file. As far as I know, C# doesn’t support that kind of cursor. What this example does do is show how to … Continue reading

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

Create ListView icons at run time in C#

The example Display large and small ListView icons in C# explains how to display ListView icons next to items. Basically, you place the images in two ImageList controls, set the ListView control’s LargeImageList and SmallImageList properties to those two controls, … Continue reading

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

Draw a cursor and use it at run time in C#

It’s not too hard to draw a cursor and use it in a C# program. The basic approach is to create a Bitmap and then create a new Cursor object, passing its constructor the Bitmap object’s icon handle as given … Continue reading

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

Fix rectangle SmoothingMode problems in C#

This example explains how to fix a rather obscure SmoothingMode problem. If you look closely at the PictureBox on the right in the picture, you’ll see that its top and leftmost pixels are not the same color as the rest … Continue reading

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

Use a custom dash pattern with WPF and XAML in C#

My post Render dashed lines in a WPF program using C# explains how a WPF program can use C# code to render lines with a custom dash pattern onto a bitmap. This post shows how to use a custom dash … Continue reading

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

Combine images in rows and columns in C#

I just finished my latest book WPF 3d, Three-Dimensional Graphics with WPF and C# and I wanted to combine images showing samples from the book into a single image. You can use a program such as MS Paint to do … Continue reading

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

Book Sample Pictures: WPF 3d

This page shows thumbnail images for my book WPF 3D, Three-Dimensional Graphics with WPF and C#. Click on a picture to see a full-sized version. [ Overview – Table of Contents – Questions and Discussion – Errata – Sample Pictures … Continue reading

Posted in 3D, 3D graphics, algorithms, books, drawing, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , | 3 Comments