Tag Archives: graphics

Graph the gamma function in C#

The post Calculate the gamma function in C# uses numerical integration to calculate the gamma function. (See my book Essential Algorithms, Second Edition for information on numerical integration.) That method works fairly well for calculating Γ(x) where x ≤ 1. … Continue reading

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

Find rectangles defined by a side and aspect ratio in C#

You probably haven’t needed to make your program draw rectangles that are defined by specifying one of its sides. I haven’t either, but I want this for another program that I plan to write. Of course a single side isn’t … Continue reading

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

Automatically set camera distance in WPF and C#

This example extends the post Build a geodesic sphere with WPF and C# to let you automatically set the camera distance to make the scene fill the viewport. Making a 3D scene fill the viewport nicely can be tricky. The … Continue reading

Posted in 3D graphics, algorithms, graphics, mathematics, wpf | Tagged , , , , , , , , , , , , , , , , | 6 Comments

Make numbered buttons in C#

This program lets you create a sequence of images that look like numbered buttons. It’s another program that I seem to recreate periodically. Click the Background and Foreground color swatches to change those colors. Use the numeric up/down controls to … Continue reading

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

Enlarge a polygon that has colinear vertices in C#

The example Enlarge a polygon in C# shows how you can expand a polygon. The basic idea is to offset each of the polygon’s edges away from the polygon’s center and then see where adjacent edges intersect as shown in … Continue reading

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

Use the mouse wheel to scale images while cropping them to a desired aspect ratio in C#

This example adds mouse wheel support to the example Crop scaled images to a desired aspect ratio in C#. Some social media platforms work best with a 4:3 aspect ratio, so I use that example almost every day to crop … Continue reading

Posted in drawing, graphics, image processing | Tagged , , , , , , , , , | 2 Comments

Allow scrolling while making a hexagonal montage in C#

The example Make a hexagonal montage of pictures in C# shows how to make a hexagonal montage similar to the one shown above. I sometimes want to make a montage that is much bigger, and that example doesn’t let you … Continue reading

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

Print product signs in C#

This is a program I recently wrote to print product signs for my bakery The Enchanted Oven. You can modify the code to use your product names and prices. In the program’s main form (upper left in the picture), select … Continue reading

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

Label images at the bottom in C#

The second step in building a Hiragana flash card program is to label images so you can understand what they mean. My last post in the series, Split images into halves in C#, showed how to split an image into … Continue reading

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

Split images into halves in C#

Sometimes I starts a project that begins simply enough but that requires me to write a couple of other programs. In this case I wanted to write a simple flash card program to display images of Japanese Hiragana characters so … Continue reading

Posted in graphics, image processing | Tagged , , , , , , , | 2 Comments