Tag Archives: colors

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

Animate rainbow colors in C#

The example Map numeric values to and from colors in a color gradient in C# draws a color gradient that uses rainbow colors. This example animates that one. When you click on the color gradient, the following code starts or … Continue reading

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

Save a color palette in a program’s settings in C#

The example Make a persistent color palette in C# shows how a program can use settings to save and restore a color palette. The program saves the palette colors as a list of ARGB color values stored in a string … Continue reading

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

Make a persistent color palette in C#

This example saves and restores the colors in a color palette when it starts and stops. It also lets the user click on a color in the palette to change its value. The program stores the colors in an array … Continue reading

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

Make a standard color palette in C#

The MakeColorPalette method shown below builds an array of PictureBoxes with BackColor properties set to a standard color palette. // Make a color palette on the given parent. private void MakeColorPalette(Control parent, int x, int y, System.EventHandler event_handler) { Color[] … Continue reading

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

List colors in WPF and C#

This example shows how to list colors and display color samples in a WPF ListBox. To build the list, the example demonstrates reflection, LINQ, and XAML data templates. The program uses the following XAML code to define the ListBox that … Continue reading

Posted in drawing, enums, graphics, LINQ, reflection, wpf, XAML | Tagged , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Draw a color wheel with alpha and saturation values in C#

The example Draw a colorful color wheel in C# shows how to draw a color wheel. This example lets you use scroll bars to change the alpha (opaqueness) and saturation (grayness) values of the colors. This is actually a pretty … Continue reading

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

Draw a colorful color wheel in C#

The example Draw a color wheel in C# draws a color wheel. To do that, it makes a series of points along the perimeter of a circle where each point has a different color of the rainbow. It then makes … Continue reading

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

Draw a color wheel in C#

The program uses a PathGradientBrush to fill a color wheel with color samples. Drawing the wheel is basically automatic but takes some effort to set up. The following DrawColorWheel method draws does all the work. // Draw a color wheel … Continue reading

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

Let the user zoom on a picture in C#

Important: This example does not handle new drawings correctly if you have scaled the image. Read this one to learn how it works and then see the new post Let the user zoom on a picture and draw in C#. … Continue reading

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