A lot of the times I have come across people not knowing how to do radial gradients, so this is the explanation.
In GDI, it isn't called radial gradient, it is a PATH GRADIENT <- REMEMBER THAT NAME!
1. Define a path with a circle
Now, first of all we need to declare us a new graphics path, like this:
and second, add a new ellipse to it (this is our RADIAL part)
2. Make a brush! (To fill our gradient)
First, we use the path to make our brush.
3. Set your colors!
Now, we set the center color of the gradient
Now, we set the outside color (this can be as many colors as you want, however the gradient we want only consists of an inside and outside color, so we only make one)
4. Draw the radial gradient!
Now, we use our graphics to fill the ellipse (radial gradient)
This will produce something like this:
[img]http://www.blackhax.com/iqa/xBxGpdbtTstRCcNtvbIi.png[/img]
Now, to make it fade out just set your inside color to something, and out outside color to Color.Transparent
Complete Code:
This is a leading example of why you should use MSDN, I found this in little under 5 minutes ( http://msdn.microsoft.com/en-us/library/...brush.aspx )
In GDI, it isn't called radial gradient, it is a PATH GRADIENT <- REMEMBER THAT NAME!
1. Define a path with a circle
Now, first of all we need to declare us a new graphics path, like this:
Code
Dim path As New GraphicsPath()and second, add a new ellipse to it (this is our RADIAL part)
Code
path.AddEllipse(0, 0, 140, 70)2. Make a brush! (To fill our gradient)
First, we use the path to make our brush.
Code
Dim pthGrBrush As New PathGradientBrush(path)3. Set your colors!
Now, we set the center color of the gradient
Code
pthGrBrush.CenterColor = Color.WhiteNow, we set the outside color (this can be as many colors as you want, however the gradient we want only consists of an inside and outside color, so we only make one)
Code
Dim colors As Color() = {Color.Red}
pthGrBrush.SurroundColors = colors4. Draw the radial gradient!
Now, we use our graphics to fill the ellipse (radial gradient)
Code
e.Graphics.FillEllipse(pthGrBrush, 0, 0, 140, 70)This will produce something like this:
[img]http://www.blackhax.com/iqa/xBxGpdbtTstRCcNtvbIi.png[/img]
Now, to make it fade out just set your inside color to something, and out outside color to Color.Transparent
Complete Code:
Code
I will not post this complete code because if you want to learn, reading through this will teach you how, if you just copy we will know you are just a noob, and will never be able to code, no hard feelings.This is a leading example of why you should use MSDN, I found this in little under 5 minutes ( http://msdn.microsoft.com/en-us/library/...brush.aspx )
![[Image: 86251a37e635a21aea7eb7e014b0d820.gif]](https://i.gyazo.com/86251a37e635a21aea7eb7e014b0d820.gif)



