Category Archives: transformations

Rotate images to straighten them in C#

I’ve written a couple of examples that show how to rotate images. I made many of them because I wanted to adjust a picture I had taken that was slightly crooked. Those examples work well, but they can be fairly … Continue reading

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

Let the user draw rotated skewed polygons in C#

The example Let the user draw rotated polygons with right angles in C# draws polygons with edges that are parallel or perpendicular to a baseline. This example is very similar except its polygons have edges that are parallel to one … Continue reading

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

Let the user draw rotated polygons with right angles in C#

This example lets the user draw rotated polygons where all edges are either parallel or perpendicular to a defined baseline direction. As a result, all of the polygon’s angles are right angles. (And yes, I know that the polygons aren’t … Continue reading

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

Map device coordinates to world coordinates in C#

Sometimes it’s convenient to draw in one coordinate system (called world coordinates) and map those coordinates to the screen’s device coordinates. The example Map points between coordinate systems in C# shows how to do this in C#. For example, the … Continue reading

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

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 , , , , , , , , , , , , , , , | 2 Comments

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 , , , , , , , , , , , , , , | 14 Comments

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

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 , , , , , , , , | 9 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 , , , , , , , , , | 7 Comments