Tag Archives: transformations

Draw improved text on a curve in C#

This example shows how to draw improved text along a curved path. The example Draw text on a curve in C# shows how to draw text along a curved path. Unfortunately the spacing between the letters is pretty mediocre in … Continue reading

Posted in algorithms, drawings, fonts, graphics, transformations | Tagged , , , , , , , , , , , , , , , | Leave a comment

Rotate images that are scaled in C#

The example Interactively rotate images in C# lets you click and drag to rotate images but it doesn’t always work well if the image you are rotating is too big to fit on the screen. The example Rotate images inside … Continue reading

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

Rotate images inside a scrolled panel in C#

The example Interactively rotate images in C# lets you click and drag to rotate images. Unfortunately it doesn’t work well with images that are too big to fit on the screen. If an image is too big, the program lets … Continue reading

Posted in algorithms, graphics, image processing, transformations | Tagged , , , , , , , , , , , , | Leave a comment

Draw an analog clock in C#

This example demonstrates several useful techniques including: Context menus Restricting a form to a region to give it a shape. Moving a form with no title bar Double buffering Drawing with transformations Drawing an analog clock When you right-click the … Continue reading

Posted in animation, drawing, forms, graphics | Tagged , , , , , , , , , , , , , , , , , | 2 Comments

Interactively rotate images in C#

The example Rotate images by an arbitrary angle in C# explains how you can rotate an image by a angle specified in a TextBox. This example lets you click and drag around the image’s center to specify the angle of … Continue reading

Posted in algorithms, graphics, image processing, transformations | Tagged , , , , , , , , | 7 Comments

Rotate images in C#

This program uses the following RotateBitmap method to rotate an image. // Return a bitmap rotated around its center. private Bitmap RotateBitmap(Bitmap bm, float angle) { // Make a Matrix to represent rotation // by this angle. Matrix rotate_at_origin = … Continue reading

Posted in algorithms, graphics, image processing, transformations | Tagged , , , , , , , , , | 5 Comments

Map drawing coordinates without distortion in C#

The post Easily map drawing coordinates in C# lets you easily map a rectangle in drawing coordinates to a rectangle in device coordinates. Often, however, you’ll want to ensure that the drawing area isn’t distorted. In other words, you don’t … Continue reading

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

Easily map drawing coordinates in C#

The example Map points between coordinate systems in C# shows several ways you can map drawing coordinates to screen coordinates. They all work but these sorts of coordinate conversions are really common if you’re doing more advanced graphics so I … Continue reading

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

Draw text on a curve in C#

The example Draw text on a line segment in C# shows how to draw text that follows a line segment. This example uses that code to draw text on a curve. The DrawTextOnPath method shown in the following code uses … Continue reading

Posted in algorithms, fonts, graphics | Tagged , , , , , , , , , , , , , , | 3 Comments

Draw text on a line segment in C#

This example shows how you can draw text on a line segment. The key is the DrawTextOnSegment method shown in the following code. This method can draw text on a line segment or below a line segment. // Draw some … Continue reading

Posted in algorithms, drawing, fonts, graphics, transformations | Tagged , , , , , , , , , , , , , , , | Leave a comment