I am trying to create a heatmap in vb.net, what I've done so far is to create gray circles, and map the bitmap with a mapping scheme to a colourized bitmap, as you can see here:
But how am I able to fade between the gray circles? Is there an easy way available?
This is how I am drawing my circles at the moment:
Dim tmpBitmap As New Bitmap(300, 300)
With Graphics.FromImage(tmpBitmap)
'.DrawLine(...)
'.DrawString(...)
Dim pth As New GraphicsPath()
pth.AddEllipse(0, 0, 150, 150)
Dim pgb As New PathGradientBrush(pth)
pgb.SurroundColors = New Color() {Color.DarkGray}
pgb.CenterColor = Color.Black
.FillRectangle(pgb, 0, 0, 150, 150)
Dim pth2 As New GraphicsPath()
pth2.AddEllipse(100, 0, 150, 150)
Dim pgb2 As New PathGradientBrush(pth2)
pgb2.SurroundColors = New Color() {Color.DarkGray}
pgb2.CenterColor = Color.Black
.FillRectangle(pgb2, 100, 0, 150, 150)
End With
Thank you!
Edit: I need it for an application very similar to what netspot does (www.netspotapp.com) so I need to set points with measurements, and I want it to look like a heatmap. Like this:
Edit2:
Sample with LinearGradientBrush. If I use LinearGradientBrush (because it's easier for testing) I set two points:
.DrawEllipse(Pens.Black, 45, 45, 10, 10)
.DrawEllipse(Pens.Black, 145, 145, 10, 10)
After that I create a LinearGradientBrush with the origin of the circles.
Dim tmpBrush As New Drawing2D.LinearGradientBrush(New Point(50, 50), New Point(150, 150), Color.FromArgb(0, 0, 0), Color.FromArgb(100, 100, 100))
.FillRectangle(tmpBrush, 0, 0, 500, 500)
This is the result, but I don't understand how to add a third point for example.