Tag Archives: fill area

Write a graphical floodfill method in C#

A floodfill fills a pixel and all of those around it that have the same color with a new color. This example draws a bunch of random circles. When you click an area between the circles’ perimeters, the program floodfills … Continue reading

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

Let the user move the center point of an elliptical gradient in C#

The example Fill an area with an elliptical gradient in C# shows how to make a brush that fills an area with an elliptical gradient. This example just lets the user move the gradient’s center point. When you move the … Continue reading

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

Fill an area with an elliptical gradient in C#

Filling an area with an elliptical gradient is non-trivial in a Windows Forms application because the .NET Framework libraries intended for use with Windows Forms don’t include a RadialGradientBrush class. There is such a class in the System.Windows.Media namespace, but … Continue reading

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