BLOG.CSHARPHELPER.COM: Let the user move the center point of an elliptical gradient in C#
Let the user move the center point of an elliptical gradient in C#
The example Fill an area with an elliptical gradient in C# explains how to make a brush that fills an area with an elliptical gradient. This example just moves the gradient's center point.
When you move the mouse, the following code saves the mouse's current position in the variable CenterPoint and then refreshes the form.
The form's Paint event handler is the same as in the previous example except it uses the following line of code to set the PathGradientBrush's center to the current center point.
Comments