Category Archives: graphics

Crop scaled images to a desired aspect ratio in C#

I often need to crop images and sometimes I want a specific aspect ratio. (In case you haven’t heard this term before, the aspect ratio is the ratio of the image’s width to height. As an equation, it’s width / … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , | 1 Comment

Colorize images in C#

This example produces some impressive results, but it’s actually quite simple. It uses ImageAttribute techniques demonstrated by several other examples to quickly manipulate an image’s colors. Adjust Color The following AdjustColor method starts the process of coloring an image. // … Continue reading

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

Test graphical transformations in C#

This example draws several pictures to let you test graphical transformations. The general approach is the same for each picture. The following section explains how the program draws the pictures that demonstrate the various graphical transformations. The sections after that … Continue reading

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

Make multi-image icons from files in C#

The post Make multi-image icon files in C# showed how to create several bitmaps at runtime and then used them to create multi-image icons in C#. This example lets you load multiple saved image files and use them to create … Continue reading

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

Make multi-image icon files in C#

The most interesting thing about icon files is that they can contain several images with different sizes. When a program needs to display the icon, it can pick the size that is appropriate. For example, Windows 10 displays icons in … Continue reading

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

Make a digital clock in C#

This example uses the techniques described in the example Draw LED-style letters in C# to draw a digital clock. That earlier example showed one way to draw LED-style letters. This example simply uses the LedText class from that post to … Continue reading

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

Draw LED-style letters in C#

Every now and then I’ve had the urge to write a digital clock program, and to do that, I need to be able to draw LED-style letters. (Some things are practically a right of passage for programmers. Writing a program … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , | 4 Comments

Use Microsoft Print to PDF to create a PDF file in C#

This example shows one way that you can make a C# program create a PDF file. It’s super easy. (I haven’t posted any easy examples for a while, so this one makes a refreshing change.) Selecting the Printer In a … Continue reading

Posted in drawing, graphics, printing | Tagged , , , , , , , , | 4 Comments

Use menu commands with shortcuts to save and restore user-drawn polygons in C# and WPF

The example Let the user edit polygons in WPF and C# shows how to let the user draw and edit polygons in WPF. This example shows how you can let the user save and restore those polygons. While I was … Continue reading

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

Pingback: Code Project post “Clipping Plane in WPF 3D”

The Code Project post Clipping Plane in WPF 3D by charles922 references a couple of my WPF 3D posts. His post explains several WPF 3D concepts including; Manger sponges (refers to my post Use a dictionary to draw a 3D … Continue reading

Posted in 3D, 3D graphics, algorithms, books, drawing, graphics, mathematics, wpf, XAML | Tagged , , , , , , , , , , , , , , | 4 Comments