Tag Archives: WPF

Let the user draw a polyline in WPF and C#

This example shows how you can let the user use the mouse to draw a polyline in and WPF application in C#. I often badmouth WPF by saying that it is “twice as flexible and only ten times as hard” … Continue reading

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

Make a pie slice drawing extension in WPF and C#

This example shows how to make an extension method to draw a pie slice easily in WPF and C#. My post Make an intuitive extension method to draw an elliptical arc in WPF and C# shows how to make an … Continue reading

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

Make an intuitive extension method to draw an elliptical arc in WPF and C#

In my previous post Draw an elliptical arc in WPF and XAML, I explained how WPF makes you define an elliptical arc. Their method almost makes sense if you want draw an arc as part of a path. however, if … Continue reading

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

Draw an elliptical arc in WPF and XAML

This example shows how to use XAML code to draw an elliptical arc in a WPF. The following sections explain how to specify an elliptical arc and how to draw one in XAML. Specifying an Elliptical Arc WPF provides several … Continue reading

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

Make drawing extension methods in WPF and C#

This example shows how to make a few handy extension methods for drawing in WPF. Drawing in WPF is at best awkward and at worst downright painful. For example, the following XAML code draws a rectangle. <Grid> <Canvas Name=”canDrawing”> <Rectangle … Continue reading

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

Graph equations while preserving aspect ratio in WPF and C#

The previous example, Graph equations entered by the user in WPF and C# shows how to graph an equation entered by the user. The user must also enter the coordinate bounds that the program should use. For example, in the … Continue reading

Posted in algorithms, drawing, graphics, mathematics, reflection, wpf | Tagged , , , , , , , , , , , , , , | 2 Comments

WPF 3d: Three-Dimensional Graphics with WPF and C#

If you haven’t checked out my book, WPF 3d: Three-Dimensional Graphics with WPF and C#, please take a quick look either on my web page or on Amazon. If you have a copy of the book, please post a review! … Continue reading

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

Graph equations entered by the user in WPF and C#

This example uses key techniques described in several examples, mostly the following two: Use transformations to draw a graph in WPF and C# Graph equations entered by the user in C# The following two sections describe the key techniques taken … Continue reading

Posted in algorithms, drawing, graphics, mathematics, reflection, wpf | Tagged , , , , , , , , , , , , , | 1 Comment

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