我正在尝试在vb.net中创建一个热图,到目前为止,我要做的是创建灰色圆圈,并使用映射方案将位图映射到彩色位图,如您在此处看到的:
但是我如何在灰色圆圈之间淡入淡出?有简单的方法吗?
这是我目前绘制圈子的方式:
new_name
谢谢!
编辑: 对于与netspot(www.netspotapp.com)非常相似的应用程序,我需要它,因此我需要通过测量来设置点,并且希望它看起来像一个热图。像这样:
Edit2:
使用LinearGradientBrush进行采样。 如果我使用LinearGradientBrush(因为它更易于测试) 我设定了两点:
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
然后,我用圆的原点创建一个LinearGradientBrush。
.DrawEllipse(Pens.Black, 45, 45, 10, 10)
.DrawEllipse(Pens.Black, 145, 145, 10, 10)
这是结果,但是例如,我不知道如何添加第三点。