Tag Archives: drawing

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

Make a sunburst chart in C#, Part 1

A sunburst chart displays hierarchical data in a circular diagram. The hierarchy’s root is drawn in the center. Its children sit in a ring around the root. After that, each node’s wedge in a ring is divided among its children … Continue reading

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

Make a shaded ellipse control in C#

Note: Before you can use the ShadedEllipse control in the example program, you must build the solution. After you download the example, build it before you try to view the form. This example walks through building a control that draws … Continue reading

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

Use digits of Pi to draw a picture in C#

The article 10 stunning images show the beauty hidden in pi shows several ways to use Pi to generate pictures. This example demonstrates one of them. The program starts drawing at the origin (0, 0). It then scans through the … Continue reading

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

Draw, move, and delete line segments in VB.NET

This progra lets you draw, move, and delete line segments from a drawing. It’s a Visual Basic .NET version of the example Draw, move, and delete line segments in C# made by request. Click and drag to draw line segments. … Continue reading

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

Convert a Rectangle into a RectangleF and vice versa in C#

The RectangleF structure has an overloaded assignment operator = that lets you simply set a RectangleF equal to a Rectangle, so converting a Rectangle into a RectangleF is easy. That makes sense because converting from Rectangle to RectangleF is a … Continue reading

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

Draw a golden spiral in C#

This example shows how to draw a golden spiral (or phi spiral) in C#. The example Draw a nested series of golden rectangles in C# draws nested rectangles and connects their corners to make a square “spiral.” This example makes … Continue reading

Posted in algorithms, drawing, graphics, mathematics | Tagged , , , , , , , , , , , , , , | 3 Comments