Tag Archives: rotated text

Draw transformed text in C#

This example uses the following Paint event handler to draw transformed text. // Draw some transformed text. private void Form1_Paint(object sender, PaintEventArgs e) { // Transform. e.Graphics.ScaleTransform(1.5f, 1.5f, MatrixOrder.Append); e.Graphics.RotateTransform(25, MatrixOrder.Append); e.Graphics.TranslateTransform(80, 30, MatrixOrder.Append); // Make a font. using (Font … Continue reading

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

Make a sunburst chart in C#, Part 4

The previous post showed how to make a sunburst chart with curved text. This example extends that one so it can draw multi-line text. The previous post used the DrawTextOnArc method to draw curved text. The text is a distance … Continue reading

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

Make a sunburst chart in C#, Part 3

The post Make a sunburst chart in C#, Part 1 shows how to build a basic sunburst chart. The post Make a sunburst chart in C#, Part 2 enhances that example by drawing each node’s text at an angle so … Continue reading

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

Make a sunburst chart in C#, Part 2

The post Make a sunburst chart in C#, Part 1 explained how to build a simple sunburst chart. Unfortunately the node labels used by that chart didn’t fit their wedges very well because the text was all drawn horizontally. This … Continue reading

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

Easily draw rotated text on a form in C#

The example Draw rotated text in C# shows how to draw rotated text. Unfortunately that method requires you to use code at run time to position the text. It’s not too hard but it’s inconvenient if you’re trying to draw … Continue reading

Posted in fonts, forms, graphics | Tagged , , , , , , , , , , , , | 1 Comment

Easily render rotated text in a WPF program using C#

The example Render text easily in a WPF program using C# shows how to make an extension method that makes rendering text easy in WPF. This example makes a similar extension method that helps you render rotated text. This is … Continue reading

Posted in drawing, extension methods, geometry, graphics, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , , | 1 Comment

Draw a labeled line graph that displays value tooltips in C#

This (fairly complicated) example maps between several different coordinate systems: The main graph is mapped from a coordinate space where 1900 ≤ x ≤ 2010 and 0 ≤ y ≤ 8000 to an area on the screen. Each data point … Continue reading

Posted in drawing, graphics, mathematics, transformations | Tagged , , , , , , , , , , , , , | 1 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

Let the user click on graph points in WPF and C#

This example shows how you can let a user click on graph points to display information about the data. (It extends the example Draw a graph with rotated text in WPF and C#.) When the user moves the mouse over … Continue reading

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