Tag Archives: graphics

Use XAML and code behind to draw and outline shapes with gradients in WPF and C#

My unofficial slogan for WPF is, “Twice and flexible and only five times as hard,” and that applies to working with gradients. Gradients are undoubted cool and very flexible, but they are verbose and a bit tricky to use. How … Continue reading

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

Let the user draw a smooth curve with WPF and C#

This example combines techniques used by the following examples. Draw a smooth curve in WPF and C# Let the user draw a smooth curve in C# The program uses the following code to keep track off what it is doing … Continue reading

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

Draw a smooth closed curve in WPF and C#

The post Draw a smooth curve in WPF and C# explains how you can create a series of Bézier curves to smoothly connect a group of points. This example shows how to modify that one to create a smooth closed … Continue reading

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

Draw a smooth curve in WPF and C#

In Windows Forms programming, you can draw a smooth curve by using the Graphics object’s DrawCurve method. For some reason, Microsoft did not provide the ability to draw a smooth curve in WPF. Fortunatrely, you can use a series of … Continue reading

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

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

Use sines and cosines to draw circles and ellipses in C#

This example shows how you can use trigonometric functions to draw circles. It’s such a basic technique that I often forget that it’s not completely obvious to everyone. Given a radius R and an angle θ, the equations x = … Continue reading

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

“WPF 3d” code is avialable on GitHub

I have posted the source code for my book WPF 3d, Three-Dimensional Graphics with WPF and C# on GitHub in this repository. Feel free to download the examples and experiment with them. If you make any particularly interesting new images, … Continue reading

Posted in 3D, 3D graphics, books, graphics, three-dimensional graphics | Tagged , , , , , , , , , , | Leave a comment

Make a picture with a transparent hole in it in C#

The example Create oval images in C# shows how to make a transparent image with an oval-shaped picture in it. This example shows how to do the converse: it makes an image with a transparent hole in the middle of … Continue reading

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

Let the user zoom on a picture and draw in C#

The example Let the user zoom on a picture in C# allows the user to zoom in on a picture and draw on it. Unfortunately, it doesn’t handle the drawing properly when the image is scaled. It doesn’t scale the … Continue reading

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

Segmented Turning Helper, Version 3

John Di Stefano has released version 3 of this free tool Segmented Turning Helper. The program helps you design segmented turning projects such as turned bowls and vases. Here’s the basic description of the tool. Segmented Turning Helper assists you … Continue reading

Posted in 3D, 3D graphics, books, drawing, graphics, wpf | Tagged , , , , , , , , , , , , | Leave a comment